Skip to content

[UPSTREAM-11] fix(python): drop the bare keyword marker from a signature with no parameters - #71

Closed
moetemp wants to merge 1 commit into
moe/up/long-pollfrom
moe/up/python-empty-request-signature
Closed

moetemp wants to merge 1 commit into
moe/up/long-pollfrom
moe/up/python-empty-request-signature

Conversation

@moetemp

@moetemp moetemp commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR drops the bare * from a Python operation signature with no params. It applies to the <Service>Client methods in services.py of a service with no @nexus.endpoint, to the operation functions, and to the methods of the client target.

Depends on #55 (UPSTREAM-9).
Part of the Brook review series.

Why?

def close_writers(self, *,) is a SyntaxError.

How did you test it?

Brook's writer has an empty close-writers request. Without the fix, the writer's client.py fails ruff format, so the samples leave Python out of the writer. With it, the writer generates for Python, with the same proto map as the service in examples.toml, and sample tests call close_writer and close_writers through a fake client. Brook's WIT already has the case, so it's one commit.
The Python 3.10 check now generates each example with its targets, as the example build does.
cargo validate passes and cargo clippy adds no warnings.

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
moetemp force-pushed the moe/up/python-empty-request-signature branch from 61072dd to 0ab0676 Compare October 25, 2026 22:19
@moetemp
moetemp force-pushed the moe/up/python-client-resources branch from 2430447 to 04274db Compare October 25, 2026 22:19
@moetemp
moetemp changed the base branch from moe/up/python-client-resources to moe/up/python-client-only October 25, 2026 22:20
@moetemp
moetemp force-pushed the moe/up/python-empty-request-signature branch from 0ab0676 to 336b95e Compare October 25, 2026 23:49
@moetemp
moetemp force-pushed the moe/up/python-client-only branch from 5380fc8 to 5978db2 Compare October 25, 2026 23:49
@moetemp
moetemp marked this pull request as ready for review October 25, 2026 23:49
@moetemp
moetemp force-pushed the moe/up/python-client-only branch from 5978db2 to da80617 Compare October 26, 2026 20:56
@moetemp
moetemp force-pushed the moe/up/python-empty-request-signature branch 2 times, most recently from 274d994 to 3c8a1e0 Compare October 26, 2026 22:34
@moetemp
moetemp changed the base branch from moe/up/python-client-only to moe/up/long-poll October 26, 2026 22:34
@moetemp
moetemp force-pushed the moe/up/python-empty-request-signature branch from 3c8a1e0 to 9625ded Compare October 26, 2026 22:37
@moetemp
moetemp force-pushed the moe/up/python-empty-request-signature branch from 9625ded to 18559cd Compare October 26, 2026 23:01
@moetemp
moetemp force-pushed the moe/up/long-poll branch 2 times, most recently from 1c3b801 to eeb1418 Compare October 27, 2026 01:06
@moetemp
moetemp force-pushed the moe/up/python-empty-request-signature branch 2 times, most recently from 8c01ed0 to da14970 Compare October 27, 2026 09:08
@moetemp
moetemp force-pushed the moe/up/long-poll branch 2 times, most recently from ac16c7b to c1e00c3 Compare October 27, 2026 18:07
@moetemp
moetemp force-pushed the moe/up/python-empty-request-signature branch from da14970 to a76f590 Compare October 27, 2026 18:07
@moetemp
moetemp force-pushed the moe/up/python-empty-request-signature branch from a76f590 to 31e7e9b Compare October 27, 2026 19:00
Python refuses a bare `*` with no parameter after it. An unpacked operation with an empty request
rendered one, which the client target hits for the writer's CloseWriters. Brook's writer now
generates for Python. The Python 3.10 check generates each example with its targets, as the
example build does.
@moetemp

moetemp commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Closing this. The Streams stack doesn't need it.

@moetemp moetemp closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant