Skip to content

Commit 46988e2

Browse files
janniklasroseIsaac
andauthored
Mark postgres_snapshot_schedules Beta and drop its PyDABs support (#6887)
## Summary `postgres_snapshot_schedules` was the only `postgres_*` resource exposed in PyDABs, while its seven siblings are Beta and PyDABs-excluded. That inconsistency traced to a dead `launchStageOverrides` entry: the type-level launch-stage override is only applied *after* `findRef` resolves a resource to an embedded Databricks SDK spec type in `.codegen/cli.json`. The snapshot-schedule resource is a hand-written singleton (`GetSnapshotSchedule` / `UpdateSnapshotSchedule` only) with no embedded spec type, so `findRef` missed, the override never fired, the schema shipped it unlabelled, and the PyDABs stage filter (which excludes `PUBLIC_BETA` / `PRIVATE_PREVIEW`) let it through. ## Changes - **`bundle/internal/schema/parser.go`**: compute the launch-stage override before the `findRef` early return and stamp the type's self descriptor on a `findRef` miss, so `launchStageOverrides` is authoritative regardless of SDK backing. - **`bundle/schema/jsonschema.json`** (regenerated): the resource object now carries `x-databricks-launch-stage: PUBLIC_BETA` and the `[Beta]` tag, matching the other `postgres_*` resources. - **PyDABs** (regenerated via `./task pydabs-codegen`): the resource is now excluded, so its Python bindings, core wiring, generated test cases, docs and public-API snapshot are removed, along with the now-obsolete `acceptance/bundle/python/postgres_snapshot_schedules-support/` fixture. The resource still works via YAML / the direct engine; its deploy/bind/invariant acceptance tests are unchanged. ## Breaking change PyDABs support for `postgres_snapshot_schedules` is removed (`Resources.add_postgres_snapshot_schedule`, `postgres_snapshot_schedule_mutator`). Configure it in YAML instead. ## Tests - `go build ./...` and `./task lint-q` clean. - `bundle/internal/schema` and `bundle/internal/annotation` unit tests pass. - Acceptance: `refschema` (unchanged), snapshot-schedule `resources` / `bind` / `invariant` pass. - PyDABs `test_python_support` (coverage guard) and `test_public_api` pass. - `./task generate-schema` is idempotent; `./task check-changelog` valid. This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
1 parent 5b4efa9 commit 46988e2

26 files changed

Lines changed: 15 additions & 795 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* The `postgres_snapshot_schedules` resource (introduced in [v1.16.0](https://github.com/databricks/cli/releases/tag/v1.16.0)) is now marked Beta and is no longer available in PyDABs, matching the other `postgres_*` resources; configure it in YAML instead. ([#6887](https://github.com/databricks/cli/pull/6887))

‎acceptance/bundle/python/postgres_snapshot_schedules-support/databricks.yml‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎acceptance/bundle/python/postgres_snapshot_schedules-support/mutators.py‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎acceptance/bundle/python/postgres_snapshot_schedules-support/out.test.toml‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎acceptance/bundle/python/postgres_snapshot_schedules-support/output.txt‎

Lines changed: 0 additions & 40 deletions
This file was deleted.

‎acceptance/bundle/python/postgres_snapshot_schedules-support/resources.py‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎acceptance/bundle/python/postgres_snapshot_schedules-support/script‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎acceptance/bundle/python/postgres_snapshot_schedules-support/test.toml‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎bundle/internal/schema/parser.go‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,22 @@ func (p *annotationParser) extractAnnotations(typ reflect.Type) (annotation.File
174174
var stageErr error
175175
_, err := jsonschema.FromType(typ, []func(reflect.Type, jsonschema.Schema) jsonschema.Schema{
176176
func(typ reflect.Type, s jsonschema.Schema) jsonschema.Schema {
177+
basePath := getPath(typ)
178+
// A type carries no launch stage by default, so we set to GA, unless
179+
// overridden. Compute the override before findRef so it still applies to
180+
// a resource with no spec type in cli.json (findRef miss) — e.g. the
181+
// hand-written postgres_snapshot_schedules singleton — which would
182+
// otherwise ship unlabelled despite its launchStageOverrides entry.
183+
typeLaunchStage := annotation.OverrideLaunchStage(basePath, "")
184+
177185
ref, ok := p.findRef(typ)
178186
if !ok {
187+
if typeLaunchStage != "" {
188+
annotations.SetSelf(basePath, annotation.Descriptor{LaunchStage: typeLaunchStage})
189+
}
179190
return s
180191
}
181192

182-
basePath := getPath(typ)
183-
// A type carries no launch stage by default, so we set to GA, unless overridden.
184-
typeLaunchStage := annotation.OverrideLaunchStage(basePath, "")
185193
enumLaunchStages, enumErr := notableEnumLaunchStages(ref.EnumLaunchStages)
186194
if enumErr != nil {
187195
stageErr = errors.Join(stageErr, fmt.Errorf("%s: %w", basePath, enumErr))

‎bundle/schema/jsonschema.json‎

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)