Skip to content

refactor(python): render each target from a target value - #323

Closed
moetemp wants to merge 1 commit into
moe/up/system-nexus-generic-interceptorsfrom
moe/up/python-render-targets
Closed

moetemp wants to merge 1 commit into
moe/up/system-nexus-generic-interceptorsfrom
moe/up/python-render-targets

Conversation

@moetemp

@moetemp moetemp commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

This PR makes the Python operation renderers that the client target shares take a target value, PythonTarget, and start each line at that target's indent. The body indent comes from that indent, one level deeper. render_request_only_operation_function keeps the Workflow indents, since only the Workflow target calls it. The PR also removes the branches for a service with no endpoint, since that service's <Service>Client has its own renderers. The output doesn't change.

It's based on #322.

Why?

#324 adds the client target, which renders the same operations as client methods. With a target value, each renderer that depends on the target takes it. moetemp#54 used a thread-local flag and re-indented text instead.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

Every sample regenerates with no change.

@moetemp moetemp added the skip-changelog No user-facing changelog fragment required label Oct 28, 2026
This was referenced Oct 28, 2026
The operation renderers that the client target shares take a `PythonTarget` and start each line
at its indent. The client target can then render the same operations as methods, with no
thread-local flag and no re-indented text. Only services with an endpoint reach these renderers,
so their branches for a service with no endpoint are gone. The output doesn't change.
@moetemp
moetemp force-pushed the moe/up/system-nexus-generic-interceptors branch from 3c0cbb6 to fd062d3 Compare October 29, 2026 07:35
@moetemp
moetemp force-pushed the moe/up/python-render-targets branch from 2196319 to 08e197f Compare October 29, 2026 07:35
@moetemp

moetemp commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #324.

@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

skip-changelog No user-facing changelog fragment required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant