Skip to content

[NOT-STREAM] feat(python): return WIT-only resource classes from the caller - #64

Closed
moetemp wants to merge 40 commits into
moe/up/python-clientfrom
moe/up/python-client-wit-resources
Closed

moetemp wants to merge 40 commits into
moe/up/python-clientfrom
moe/up/python-client-wit-resources

Conversation

@moetemp

@moetemp moetemp commented Oct 23, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR lets the Python --client caller call an operation that returns a WIT-only resource, or a record that holds one. The caller decodes the JSON answer into the class from _resources.

Why?

The caller refused any operation that returns a resource without a proto wire type, so a WIT-only service with a create got no caller.

How did you test it?

The stream-service sample turns on client = true, and its client.py golden shows create_stream returning CreateStreamResult. A sample test decodes an answer over a fake transport and checks that result.stream is a Stream.

This PR is based on fork PR #54, and it merges fork PR #56 for the stream-service sample.

…ult-record-holds-resource

# Conflicts:
#	src/generator/typescript.rs
* Skipped docstrings when Python picks the names to import.

* Reworded the changelog line for the docstring import fix.
…lio#268)

* Made Python resource methods valid for any WIT parameter order.

* Took undefined for optional TS params before a required one.

* Showed the keyword-only resource method in the user-service sample.

* Dropped the TypeScript unit test that the user-service golden replaces.
# Conflicts:
#	advanced/samples/inputs/examples.toml
# Conflicts:
#	advanced/samples/inputs/examples.toml
#	src/generator/dotnet.rs
#	src/generator/python.rs
#	src/planning/mod.rs
# Conflicts:
#	advanced/samples/inputs/examples.toml
#	src/generator/python.rs
# Conflicts:
#	advanced/samples/inputs/examples.toml
# Conflicts:
#	advanced/samples/dotnet/wit/stream-service/Models.cs
#	advanced/samples/dotnet/wit/stream-service/Operations.cs
#	advanced/samples/dotnet/wit/stream-service/Services.cs
#	advanced/samples/inputs/examples.toml
#	src/generator/dotnet.rs
#	src/planning/mod.rs
@moetemp moetemp changed the title [UPSTREAM-8] feat(python): return WIT-only resource classes from the caller [NOT-STREAM] feat(python): return WIT-only resource classes from the caller Oct 23, 2026
@moetemp

moetemp commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

Closed as NOT-STREAM. Streaming resources are proto-backed, and the caller already handles a proto wire type.

@moetemp moetemp closed this Oct 23, 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