Conversation
The codegen/ module (live workspace -> Python define_* source) was fully implemented and unit-tested but unreachable from any CLI command. Add an --as-code flag to `tinybird pull` that uses it to emit datasources.py/pipes.py/client.py instead of raw .datasource/.pipe/.connection files, and wire `pull` itself to the CLI entry point (previously delegated to the upstream tb package). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Plain `tinybird pull` duplicated what the installed Tinybird CLI already does, breaking the project's delegation policy. Only `--as-code` has no CLI equivalent (it generates Python SDK source via the codegen module instead of raw datafiles), so that's the only case the SDK should own. Everything else, including bare `pull`, now goes through the real CLI like every other non-SDK-owned command. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
codegen/module (live workspace resources → Pythondefine_*source) was fully implemented and unit-tested but unreachable fromgenerate,pull, ormigrate.tinybird pull --as-code, rather than a brand-new subcommand.pullalready fetches live workspace resources;--as-codejust swaps the output format from raw.datasource/.pipe/.connectiondatafiles to Python source (datasources.py,pipes.py,client.pyviagenerate_all_files). This avoids a parallel "fetch workspace resources" code path and matches the ticket's suggested direction.pullitself is not yet wired to the CLI entry point onmain(it currently delegates to the upstreamtbpackage, same asbuild/deploy/dev/login/branch/info/preview— each being wired in its own separate PR per PROTM-2255's sub-tickets, e.g. Wire native build/deploy/dev commands to CLI entry point #25, Wire native pull/login commands to CLI entry point #26, Wire native branch/info/preview commands to CLI entry point #27). This PR wirespullto the CLI itself so it's independently testable and mergeable; expect a small merge conflict incli/index.pyagainst PR Wire native pull/login commands to CLI entry point #26 (which also wirespull, without--as-code) — trivial to resolve by keeping both changes, whichever merges second.ResourceFileTypeto include"code"so the three generated files can flow through the sameResourceFile/write-loop machinery as datafile pulls.Closes PROTM-2259: https://linear.app/tinybird/issue/PROTM-2259/python-sdk-wire-reverse-codegen-live-workspace-python-code-into-a-cli
Checklist
lint,typecheck,test,secrets)pre-commit run --all-filespasses locally (gitleaks step fails in this sandbox on an unrelated SSL/network error fetching its pre-commit env, not a code issue)README.md/CONTRIBUTING.md) if neededCHANGELOG.mdwas updated when user-facing behavior changed