WIP minor refactoring of autogen code - #6573
Closed
Sankalp-Mittal wants to merge 9 commits into
Closed
Conversation
Map the SDK time.Time type to Python str (an RFC3339 timestamp string, matching how the Go side models it in libs/dyn/convert/sdk_native_types.go) and mark it terminal for reachability, so codegen no longer fails on it. This lets resources.Secret (whose expire_time field is a *time.Time) drop off the denylist and generate. Co-authored-by: Isaac <no-reply@databricks.com>
Adds the secrets-support fixture required by test_python_support_coverage. It loads a Secret from YAML and Python, runs a secret_mutator over both, and exercises the expire_time field (RFC3339 string) end to end. value is a default-less variable reference supplied at validate time, as the secret value validator requires; direct-engine only. Co-authored-by: Isaac <no-reply@databricks.com>
_synth_scalar only knew string/int/float/bool, so a required time.Time field would fail codegen with "Unknown primitive: time.Time". Add a case producing an RFC3339 placeholder string (time.Time generates as str). No effect on current output: the only time.Time field, secrets.expire_time, is optional and dropped by the field policy before synthesis. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
- Use _STAGE_RANK.get(prop.stage, 0) so an unknown/absent launch stage is treated as GA instead of raising KeyError and killing codegen. - Route _synth_ref's module resolution through _module_of to avoid duplicating the get_package + assert logic. - Add __test__ = False to TestCase so pytest stops trying to collect it. Co-authored-by: Isaac <no-reply@databricks.com>
The four GeneratedField branches differed in only a couple of kwargs; build one base field and override the per-branch deltas via replace(), keeping pyright's type checking intact. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 7bc1873
Top 11 slowest tests (at least 2 minutes):
|
Base automatically changed from
sankalp-mittal/cli-secrets-support
to
sankalp-mittal/pydabs-jobs-tests-normalize
September 8, 2026 16:18
Sankalp-Mittal
deleted the branch
sankalp-mittal/pydabs-jobs-tests-normalize
September 8, 2026 16:18
Collaborator
Author
|
Superseded by #6575 (this PR was auto-closed when the stack it was based on merged to |
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
Minor follow-up refactoring on the PyDABs autogen code, addressing non-blocking review comments left on earlier PRs (#6421, #6528). Stacked on top of #6553.
Details
generated_test_cases.py_STAGE_RANK.get(prop.stage, 0)instead of a bare dict lookup, so an unknown/absent launch stage is treated as GA rather than raisingKeyErrorand killing codegen (matches the GolaunchStageRanksemantics)._synth_ref's module resolution through_module_ofto drop the duplicatedget_package(...) + assertlogic._resource_test_case.py: add__test__ = FalsetoTestCaseso pytest stops trying to collect it as a test class.generated_dataclass.py: collapse the four near-duplicateGeneratedField(...)branches ingenerate_fieldinto one base value plus per-branchdataclasses.replace(...)deltas (keeps pyright's type checking intact).All changes are behavior-preserving: regenerating the PyDABs output produces a byte-identical tree. Codegen unit tests (38) and
test_resources.py(223) pass.This pull request and its description were written by Isaac.