Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 215
[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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
7612d1bcf22af4e881b5f15a20d668e1b7fa0b0f66251596dc0db93497cb2e732adbe75848f32ba1d8c2084dabfbec18b7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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