Skip to content

Generate all public-preview and GA PyDABs resources - #6528

Open
Sankalp-Mittal wants to merge 10 commits into
sankalp-mittal/pydabs-acceptance-tests-skillfrom
sankalp-mittal/pydabs-generate-all-resources
Open

Generate all public-preview and GA PyDABs resources#6528
Sankalp-Mittal wants to merge 10 commits into
sankalp-mittal/pydabs-acceptance-tests-skillfrom
sankalp-mittal/pydabs-generate-all-resources

Conversation

@Sankalp-Mittal

@Sankalp-Mittal Sankalp-Mittal commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Warning

One thing to keep in mind here is, some resource fields that were not marked as experimental because they were Public Beta, will now be marked as Experimental, since we are marking as experimental both on Public Beta and Private Preview.

Changes

Removes the hardcoded RESOURCE_NAMESPACE allowlist and derives the PyDABs resource set from the bundle schema's Resources struct, so every eligible resource is generated automatically.

Added (17): apps, clusters, database_catalogs, database_instances, experiments, external_locations, instance_pools, job_runs, model_serving_endpoints, models, quality_monitors, registered_models, secret_scopes, sql_warehouses, synced_database_tables, vector_search_endpoints, vector_search_indexes.

(6 were already generated — jobs, pipelines, catalogs, schemas, volumes, alerts — for 23 total.)

Not added:

  • Below Public Preview (Public Beta), excluded by the stage gate: postgres_projects, postgres_branches, postgres_endpoints, postgres_catalogs, postgres_databases, postgres_roles, postgres_synced_tables.
  • Uses a field type the generator can't model yet (denylisted): cluster_policies, dashboards, genie_spaces (arbitrary JSON — Go interface{}); secrets (time.Time).

Why

Complete resource coverage for PyDABs.

Tests

Testing is handled by the related PRs in the stack (#6516, #6421, #6527): generated per-resource unit tests and the acceptance coverage guard that requires a fixture per resource.

Sankalp-Mittal and others added 4 commits September 4, 2026 12:29
class_name.lower() ran multi-word type names together (e.g.
vectorsearchindex). Snake-case the type name instead. No-op for the
6 currently-wired single-word resources.

Co-authored-by: Isaac <no-reply@databricks.com>
Extend the experimental marker (previously private-preview only) to
public-beta fields and enums via is_experimental_stage. Beta and
private preview may still change; GA and public preview are frozen.

Co-authored-by: Isaac <no-reply@databricks.com>
Enum values with non-identifier characters (e.g. "amazon-bedrock")
produced invalid Python member names. Replace runs of non-alphanumeric
characters with an underscore.

Co-authored-by: Isaac <no-reply@databricks.com>
Derive the resource set from the Resources struct in the bundle schema
instead of a hardcoded allowlist, excluding denylisted resources and
those below public preview. Adds 17 resources (23 total).

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 7c96c9c

Run: 33881264301

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux 1 275 32 6:02
💚​ aws windows 1 277 30 4:03
💚​ azure linux 1 274 32 6:05
💚​ azure windows 1 276 30 4:05
💚​ gcp linux 1 275 32 6:35
💚​ gcp windows 1 277 30 4:06
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:04 gcp windows TestAccept
4:03 azure windows TestAccept
4:01 aws windows TestAccept
3:56 gcp linux TestAccept
3:52 azure linux TestAccept
3:49 aws linux TestAccept

Sankalp-Mittal and others added 2 commits September 4, 2026 13:05
…-tests-skill' into sankalp-mittal/pydabs-generate-all-resources
One acceptance/bundle/python/<plural>-support/ fixture per newly
generated resource, satisfying the test_python_support_coverage guard.
Each loads an instance from YAML and one from Python and runs a mutator
over both.

Co-authored-by: Isaac <no-reply@databricks.com>
Comment thread python/codegen/codegen/jsonschema.py
default_factory="dict",
create_func_default="None",
experimental=prop.stage == LaunchStage.PRIVATE_PREVIEW,
experimental=is_experimental_stage(prop.stage),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lots of repetition here when only a few kwargs are different in the if-elif cases. can we do (as follow-up)

fieldKwargs = dict(
  field_name=field_name,
  ...
)

if field_type.name == "VariableOrDict":
  fieldKwargs["default_factory"] = "dict"
elif:
  fieldKwargs["another_field"] = "another non-default value"

return GeneratedField(**fieldKwargs)

}

# Only GA and public-preview resources are generated; later stages may still change.
_EXCLUDED_RESOURCE_STAGES = {"PUBLIC_BETA", "PRIVATE_PREVIEW"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the overlap with jsonschema.py's experimental stage? let's use a single source of truth

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of them assert different behavior, this will completely remove these resources from being generated, while the jsonschema.py experimental marker is for the fields in resources. That's why I want to keep them different

node = config.get(type_name, {})
if "x-databricks-launch-stage" in node:
return node["x-databricks-launch-stage"]
for option in node.get("oneOf", []):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for an enum iirc, but the function is _resource_stage - are we overloading it here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are checking if the launch-stage is present in the node, and if not we iterate through its possible shapes and if launch-stage is present in any of them we return it. I don't think I understood your original question properly but this is what it does

Sankalp-Mittal and others added 4 commits September 4, 2026 13:26
…-tests-skill' into sankalp-mittal/pydabs-generate-all-resources
…-tests-skill' into sankalp-mittal/pydabs-generate-all-resources
Co-authored-by: Isaac <no-reply@databricks.com>
@Sankalp-Mittal Sankalp-Mittal changed the title WIP: Generate all public-preview and GA PyDABs resources Generate all public-preview and GA PyDABs resources Sep 4, 2026
@Sankalp-Mittal
Sankalp-Mittal marked this pull request as ready for review September 4, 2026 15:19
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

121 files changed
Suggested: @janniklasrose
Also eligible: @shreyas-goenka, @pietern, @andrewnester, @denik, @anton-107, @lennartkats-db

General files (require maintainer)

304 files changed
Based on git history:

  • @janniklasrose -- recent work in python/databricks/bundles/pipelines/_models/, python/databricks/bundles/jobs/_models/, python/codegen/codegen/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@@ -81,5 +81,6 @@ def get_code(generated: GeneratedEnum) -> str:

def _camel_to_upper_snake(value):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issues with changing fields with - to python variables, since they are not allowed

@@ -61,6 +61,8 @@ class AiRuntimeTask:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the changes that are referred to in the PR warning that change earlier normal stuff to be marked [EXPERIMENTAL]

@@ -40,6 +40,8 @@ class IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again also potentially controversial change

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.

3 participants