Repository navigation
[UPSTREAM-13] fix(python): import record types that an endpoint-less client uses in unpacked parameters - #69
Closed
moetemp wants to merge 2 commits into
Conversation
moetemp
changed the base branch from
moe/up/main
to
moe/up/python-caller-docstring-indent
October 23, 2026 07:00
moetemp
added a commit
to temporalio/nexgen
that referenced
this pull request
Oct 23, 2026
) ## What changed? This PR adds a `stream-service` sample for Python and TypeScript, with today's output. #272 adds .NET with its fix. It has a `stream` resource built from a ref, `create-stream`, append, read, describe and close, with 64-bit offsets, payloads and durations. Its records are proto-backed, as a stream service's are. Upstream has no stream protos, so the sample has its own small proto in `descriptors/streamsample/v1/`, with checked-in bindings. The samples README has the commands that regenerate them. `build_examples` now loads every `*.bin` under `descriptors/`. ## Why? Later fixes show their effect as a golden diff on this sample. ## How did you test it? The goldens. A TypeScript test sends a full `ReadRecordsRequest` through the converter, so the TypeScript type file can't drift from the proto. ## What comes next These fixes are ready, in this order. Each one adds its shape to this sample, then the fix. - #272: adds .NET, where the `stream` field of the `Stream` class fails with CS0542, then the fix. - [moetemp#52](moetemp#52): Check required resource fields of a response. Adds `create-stream` returning the `stream` resource. - [moetemp#56](moetemp#56): Allow a result record to hold a resource. Adds a `create-stream-result` holder record. - [moetemp#53](moetemp#53): Emit `@nexus.doc` on resources and methods as Python docstrings. - [moetemp#70](moetemp#70): Convert 64-bit resource method values to `Long` for a proto request in TypeScript. Adds 64-bit method parameters. Needs #265. - [moetemp#54](moetemp#54): Generate a Python caller per service over a transport. Turns on the client for the sample. - [moetemp#55](moetemp#55): Add `@nexus.long-poll` to the Python caller. Marks `read-records` as a long poll. - [moetemp#57](moetemp#57): Add Python client classes for resources with methods. - [moetemp#71](moetemp#71): Drop the bare keyword marker from a Python signature with no parameters. Adds a `stream-writer` interface with no endpoint. - [moetemp#60](moetemp#60): Indent the docstrings of Python caller methods. Adds a doc on a writer operation. - [moetemp#69](moetemp#69): Import record types that an endpoint-less Python client uses in unpacked parameters. Adds `open-writer`. - [moetemp#72](moetemp#72): Plan proto unsigned integers as unsigned. Adds a `uint64` writer id. - [moetemp#73](moetemp#73): Build a returned proto-wire resource in an endpoint-less TypeScript client. Makes `open-writer` return the `writer` resource. #262 adds a `status` enum to the holder record once it merges.
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
from
October 25, 2026 22:19
6d420d5 to
be12a99
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
from
October 25, 2026 22:19
7fe0885 to
c3c1da4
Compare
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
from
October 25, 2026 23:49
be12a99 to
e57d57e
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
from
October 25, 2026 23:49
c3c1da4 to
8077f09
Compare
moetemp
marked this pull request as ready for review
October 25, 2026 23:49
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
from
October 26, 2026 20:56
e57d57e to
c161da3
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
from
October 26, 2026 20:56
8077f09 to
5a96423
Compare
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
from
October 26, 2026 22:34
c161da3 to
706c72b
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
2 times, most recently
from
October 26, 2026 22:37
a85def5 to
d6df728
Compare
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
2 times, most recently
from
October 26, 2026 23:01
c6d8eef to
b0bfecd
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
from
October 26, 2026 23:01
d6df728 to
10b1a85
Compare
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
from
October 27, 2026 01:06
b0bfecd to
e8cba15
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
2 times, most recently
from
October 27, 2026 09:08
207f3e6 to
993cf8a
Compare
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
from
October 27, 2026 18:07
49813da to
c1ea94f
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
from
October 27, 2026 18:07
993cf8a to
8d54083
Compare
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
from
October 27, 2026 19:00
c1ea94f to
eabeb6b
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
from
October 27, 2026 19:00
8d54083 to
9401eef
Compare
An endpoint-less service object unpacks the request into parameters. A parameter can have the type of another record of the module, which the module did not import.
A parameter can have a type from another module, such as a `duration` that is a `datetime.timedelta`, and the service module didn't import it. The `max-retry-duration` of Brook's writer shows it, and the Python checks no longer skip the writer's caller.
moetemp
force-pushed
the
moe/up/python-caller-docstring-indent
branch
from
October 28, 2026 00:24
eabeb6b to
edaa352
Compare
moetemp
force-pushed
the
moe/up/python-client-record-imports
branch
from
October 28, 2026 00:24
9401eef to
b4b1ed3
Compare
This was referenced Oct 28, 2026
Owner
Author
|
Closing this. The Streams stack doesn't need 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 imports the types of the unpacked params of a
<Service>Clientclass inservices.py, which a service with no@nexus.endpointgets.typing.TYPE_CHECKING.datetimefor aduration.Depends on #60 (UPSTREAM-12).
Part of the Brook review series.
Why?
services.pyimported only the input and output models, so such a param failedruffwith F821.How did you test it?
Brook's
open-writerrequest takesstream-ref,producerandworkflow-task-epochfrom the stream service package with a cross-packageuse, and aduration. Without the fixes, the writer'sservices.pyfailsruffwith F821, so #60 makes the Python checks skip it. After the first fix, onlydatetimeis missing. After the second, the checks no longer skip the file.Brook's WIT already has both cases, so the PR is the two fix commits.
cargo validatepasses andcargo clippyadds no warnings.