Repository navigation
Conversation
moetemp
marked this pull request as draft
October 27, 2026 07:48
moetemp
force-pushed
the
moe/up/flattened-setup-indent
branch
from
October 28, 2026 16:37
d083e2e to
026f1d0
Compare
This was referenced Oct 28, 2026
This was referenced Oct 28, 2026
1 of 3 tasks
moetemp
force-pushed
the
moe/up/ts-long-resource-params
branch
from
October 29, 2026 04:00
9e1d318 to
566af30
Compare
moetemp
force-pushed
the
moe/up/flattened-setup-indent
branch
2 times, most recently
from
October 29, 2026 06:28
2b18cce to
bca32e1
Compare
moetemp
force-pushed
the
moe/up/ts-long-resource-params
branch
2 times, most recently
from
October 29, 2026 07:00
8c475f3 to
a649a98
Compare
moetemp
force-pushed
the
moe/up/flattened-setup-indent
branch
from
October 29, 2026 07:00
bca32e1 to
1967f3a
Compare
The sample takes Brook's WIT, on the Stream protos of temporalio/api#895 at 482ec010. No SDK has those protos, so the sample projects hold their bindings. Only .NET generates the service, since Python and TypeScript panic on the read item's oneof.
Python and TypeScript panic on it, so their outputs keep their previous content. .NET types each case as the raw proto message, not as its record.
Variant planning kept such a case as the raw proto message. Python and TypeScript then panicked on a message conversion that wasn't model-shaped, and .NET typed the case as the proto class. The case plans as the record, as a record field does. A .NET case record names its payload's model in full, since it hides a model of its own name. Brook's stream service generates for TypeScript, and its .NET read item holds the records.
nexgen maps every temporal/... proto to a temporalio module. The Stream protos aren't in temporalio yet, so the service's imports don't resolve, and basedpyright skips it.
nexgen ships `proto/nexus/options.proto`, whose `nexus.python_module` file option names the Python module of a file's messages and enums. nexgen reads it from the raw descriptor bytes, since prost drops extension fields. The stream sample's protos set it, so Python imports them from the sample's streamprotos package, and basedpyright checks the stream service.
A proto-backed request holds a 64-bit integer as a `Long`, but a resource method took a number. A Brook offset doesn't fit in a number. A resource field or method param that a proto message of the request reads is a `Long`, so it goes into the request as it is. A 64-bit map key there is a string, as in the request model. Brook's stream service type-checks.
Python's client of a service with no endpoint sets up a flattened record at the module indent, so its services.py doesn't parse and the Python output keeps its previous content.
The setup of a @nexus.flatten-in-api record always took the indent of a module function. In a method of the client of a service with no endpoint, the code then left the method body, and services.py didn't parse. The user-service client generates its update_profile method.
moetemp
force-pushed
the
moe/up/flattened-setup-indent
branch
from
October 29, 2026 07:35
1967f3a to
cf1a028
Compare
moetemp
force-pushed
the
moe/up/ts-long-resource-params
branch
2 times, most recently
from
October 29, 2026 09:29
cbdf5c3 to
770e53a
Compare
Contributor
Author
|
Closing this. moetemp#85 takes the fix, where the stream sample needs it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
This PR renders the setup of a
@nexus.flatten-in-apirecord at the method body indent, in the Python<Service>Clientof a service with no@nexus.endpoint.The first commit gives
user-serviceanupdate-profileoperation with two flattened records, with today's output. One record has a required field, and the other has only optional fields. Python has no output in that commit, since itsservices.pydoesn't parse. The second commit is the fix.It's based on #296.
Why?
The setup took the indent of a module function, so its lines weren't inside the method body and
services.pydidn't parse.How did you test it?
Link to a test plan if any -
test_user_service.pycallsupdate_profilefrom a Workflow on a real Nexus endpoint, with the optional record set and unset, and checks each request.