-
Notifications
You must be signed in to change notification settings - Fork 123
[Python] Move 'python' outside of experimental #3540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7612d1b
cf22af4
e881b5f
15a20d6
68e1b7f
a0b0f66
251596d
c0db934
97cb2e7
32adbe7
5848f32
ba1d8c2
084dabf
bec18b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| bundle: | ||
| name: my_project | ||
|
|
||
| sync: {paths: []} # don't need to copy files | ||
|
|
||
| # We DO NOT allow specifying both 'python' and 'experimental/python' if they are not equal. | ||
|
|
||
| experimental: | ||
| python: | ||
| resources: | ||
| - "resources:load_resources" | ||
|
|
||
| python: | ||
| resources: | ||
| - "resources:load_resources" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
|
|
||
| >>> uv run [UV_ARGS] -q [CLI] bundle validate --output json --include-locations | ||
| { | ||
| "experimental": { | ||
| "python": { | ||
| "resources": [ | ||
| "resources:load_resources" | ||
| ] | ||
| } | ||
| }, | ||
| "resources": { | ||
| "jobs": { | ||
| "my_job": { | ||
| "deployment": { | ||
| "kind": "BUNDLE", | ||
| "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/my_project/default/state/metadata.json" | ||
| }, | ||
| "edit_mode": "UI_LOCKED", | ||
| "format": "MULTI_TASK", | ||
| "max_concurrent_runs": 1, | ||
| "name": "My Job", | ||
| "queue": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "__locations": { | ||
| "files": [ | ||
| "__generated_by_python__.yml", | ||
| "databricks.yml", | ||
| "resources.py" | ||
| ], | ||
| "locations": { | ||
| "bundle": [ | ||
| [ | ||
| 1, | ||
| 2, | ||
| 3 | ||
| ] | ||
| ], | ||
| "experimental": [ | ||
| [ | ||
| 1, | ||
| 9, | ||
| 3 | ||
| ] | ||
| ], | ||
| "python": [ | ||
| [ | ||
| 1, | ||
| 14, | ||
| 3 | ||
| ] | ||
| ], | ||
| "resources": [ | ||
| [ | ||
| 0, | ||
| 1, | ||
| 880 | ||
| ] | ||
| ], | ||
| "resources.jobs": [ | ||
| [ | ||
| 0, | ||
| 1, | ||
| 889 | ||
| ] | ||
| ], | ||
| "resources.jobs.my_job": [ | ||
| [ | ||
| 2, | ||
| 6, | ||
| 1 | ||
| ] | ||
| ], | ||
| "sync": [ | ||
| [ | ||
| 1, | ||
| 4, | ||
| 7 | ||
| ] | ||
| ] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| from databricks.bundles.core import Resources | ||
|
|
||
|
|
||
| def load_resources() -> Resources: | ||
| resources = Resources() | ||
| resources.add_job( | ||
| resource_name="my_job", | ||
| job={"name": "My Job"}, | ||
| ) | ||
|
|
||
| return resources |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| echo "$DATABRICKS_BUNDLES_WHEEL" > "requirements-latest.txt" | ||
|
|
||
| # each job should record location where add_job function was called | ||
|
|
||
| trace uv run $UV_ARGS -q $CLI bundle validate --output json --include-locations | \ | ||
| jq "pick(.experimental.python, .resources, .__locations.files, .__locations.locations)" | ||
|
|
||
| rm -fr .databricks __pycache__ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| bundle: | ||
| name: my_project | ||
|
|
||
| sync: {paths: []} # don't need to copy files | ||
|
|
||
| # We allow specifying both 'python' and 'experimental/python' if they are equal. | ||
|
|
||
| experimental: | ||
| python: | ||
| resources: | ||
| - "resources:load_resources_1" | ||
|
|
||
| python: | ||
| resources: | ||
| - "resources:load_resources_2" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
|
|
||
| >>> uv run [UV_ARGS] -q [CLI] bundle validate --output json --include-locations | ||
| Error: failed to apply python mutator: 'experimental/python' and 'python' configuration properties are mutually exclusive, use only 'python' | ||
|
|
||
| { | ||
| "experimental": { | ||
| "python": { | ||
| "resources": [ | ||
| "resources:load_resources_1" | ||
| ] | ||
| } | ||
| }, | ||
| "resources": null, | ||
| "__locations": { | ||
| "files": null, | ||
| "locations": null | ||
| } | ||
| } | ||
|
|
||
| Exit code: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| echo "$DATABRICKS_BUNDLES_WHEEL" > "requirements-latest.txt" | ||
|
|
||
| # each job should record location where add_job function was called | ||
|
|
||
| trace uv run $UV_ARGS -q $CLI bundle validate --output json --include-locations | \ | ||
| jq "pick(.experimental.python, .resources, .__locations.files, .__locations.locations)" | ||
|
|
||
| rm -fr .databricks __pycache__ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| bundle: | ||
| name: my_project | ||
|
|
||
| sync: {paths: []} # don't need to copy files | ||
|
|
||
| # We keep support for experimental section for backward-compatibility until it's fully deprecated. | ||
| # | ||
| # The next step until deletion is returning an error when 'experimental/python' is used. | ||
|
|
||
| experimental: | ||
| python: | ||
| resources: | ||
| - "resources:load_resources" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
|
|
||
| >>> uv run [UV_ARGS] -q [CLI] bundle validate --output json --include-locations | ||
| { | ||
| "experimental": { | ||
| "python": { | ||
| "resources": [ | ||
| "resources:load_resources" | ||
| ] | ||
| } | ||
| }, | ||
| "resources": { | ||
| "jobs": { | ||
| "my_job": { | ||
| "deployment": { | ||
| "kind": "BUNDLE", | ||
| "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/my_project/default/state/metadata.json" | ||
| }, | ||
| "edit_mode": "UI_LOCKED", | ||
| "format": "MULTI_TASK", | ||
| "max_concurrent_runs": 1, | ||
| "name": "My Job", | ||
| "queue": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "__locations": { | ||
| "files": [ | ||
| "__generated_by_python__.yml", | ||
| "databricks.yml", | ||
| "resources.py" | ||
| ], | ||
| "locations": { | ||
| "bundle": [ | ||
| [ | ||
| 1, | ||
| 2, | ||
| 3 | ||
| ] | ||
| ], | ||
| "experimental": [ | ||
| [ | ||
| 1, | ||
| 11, | ||
| 3 | ||
| ] | ||
| ], | ||
| "resources": [ | ||
| [ | ||
| 0, | ||
| 1, | ||
| 825 | ||
| ] | ||
| ], | ||
| "resources.jobs": [ | ||
| [ | ||
| 0, | ||
| 1, | ||
| 834 | ||
| ] | ||
| ], | ||
| "resources.jobs.my_job": [ | ||
| [ | ||
| 2, | ||
| 6, | ||
| 1 | ||
| ] | ||
| ], | ||
| "sync": [ | ||
| [ | ||
| 1, | ||
| 4, | ||
| 7 | ||
| ] | ||
| ] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| from databricks.bundles.core import Resources | ||
|
|
||
|
|
||
| def load_resources() -> Resources: | ||
| resources = Resources() | ||
| resources.add_job( | ||
| resource_name="my_job", | ||
| job={"name": "My Job"}, | ||
| ) | ||
|
|
||
| return resources |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| echo "$DATABRICKS_BUNDLES_WHEEL" > "requirements-latest.txt" | ||
|
|
||
| # each job should record location where add_job function was called | ||
|
|
||
| trace uv run $UV_ARGS -q $CLI bundle validate --output json --include-locations | \ | ||
| jq "pick(.experimental.python, .resources, .__locations.files, .__locations.locations)" | ||
|
|
||
| rm -fr .databricks __pycache__ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to have acceptance tests for new functionality:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , added in the latest commit