-
Notifications
You must be signed in to change notification settings - Fork 153
Fix pipeline globs #2723
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
Merged
Merged
Fix pipeline globs #2723
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1be0d91
Fix pipeline globs
kanterov 24357e3
Fix fmt
kanterov c1eba41
Add acceptance test
kanterov 7dcca59
Fix fmt
kanterov e6fe266
Fix fmt
kanterov 8e0ad0a
Add more tests
kanterov d2d7cd5
Add changelog
kanterov 64a94b4
Merge branch 'main' into fix-pipeline-globs-v1
kanterov 50c72a8
Update NEXT_CHANGELOG.md
kanterov 60b194b
Remove unused code
kanterov 9cfb05d
Fix tests
kanterov a099141
Fix tests
kanterov e45e3cf
Fix whitespace
kanterov 05aa316
Fix whitespace
kanterov 5205e6c
Update tests
kanterov 801f77a
Update changelog
kanterov a536382
Fix script
kanterov 033f4ed
Fix script
kanterov 471ee21
Update NEXT_CHANGELOG.md
kanterov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
13 changes: 13 additions & 0 deletions
13
acceptance/bundle/paths/invalid_pipeline_globs/databricks.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| bundle: | ||
| name: invalid_pipeline_glob_paths | ||
|
|
||
| resources: | ||
| pipelines: | ||
| nyc_taxi_pipeline: | ||
| libraries: | ||
| - notebook: { path: "${var.notebook_dir}/*.ipynb" } | ||
|
|
||
| variables: | ||
| notebook_dir: | ||
| description: Directory with DLT notebooks | ||
| default: non-existent |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
|
|
||
| >>> [CLI] bundle validate --output json | ||
| Error: notebook non-existent/*.ipynb not found | ||
|
|
||
|
|
||
| Exit code: 1 | ||
| { | ||
| "resources": { | ||
| "pipelines": { | ||
| "nyc_taxi_pipeline": { | ||
| "libraries": [ | ||
| { | ||
| "notebook": { | ||
| "path": "non-existent/*.ipynb" | ||
| } | ||
| } | ||
| ], | ||
| "permissions": [] | ||
| } | ||
| } | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| errcode trace $CLI bundle validate --output json | jq 'pick(.resources)' |
10 changes: 10 additions & 0 deletions
10
acceptance/bundle/paths/pipeline_expected_file_got_notebook/databricks.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| bundle: | ||
| name: pipeline_expected_file_got_notebook | ||
|
|
||
| include: | ||
| - resources/pipeline.yml | ||
|
|
||
| variables: | ||
| notebook_dir: | ||
| description: Directory with DLT notebooks | ||
| default: notebooks |
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
acceptance/bundle/paths/pipeline_expected_file_got_notebook/output.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
|
|
||
| >>> [CLI] bundle validate --output json | ||
| Error: expected a file for "resources.pipelines.nyc_taxi_pipeline.libraries[0].file.path" but got a notebook: file at [TEST_TMP_DIR]/notebooks/nyc_taxi_loader.py is a notebook | ||
|
|
||
|
|
||
| Exit code: 1 | ||
| { | ||
| "resources": { | ||
| "pipelines": { | ||
| "nyc_taxi_pipeline": { | ||
| "libraries": [ | ||
| { | ||
| "file": { | ||
| "path": "notebooks/nyc_taxi_loader.py" | ||
| } | ||
| } | ||
| ], | ||
| "permissions": [] | ||
| } | ||
| } | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/paths/pipeline_expected_file_got_notebook/resources/pipeline.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| resources: | ||
| pipelines: | ||
| nyc_taxi_pipeline: | ||
| libraries: | ||
| # path points to a notebook, not a file, it should error out | ||
| - file: { path: "../${var.notebook_dir}/*.py" } |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/paths/pipeline_expected_file_got_notebook/script
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| errcode trace $CLI bundle validate --output json | jq 'pick(.resources)' |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # this file should never be used, because glob points to a different file |
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/paths/pipeline_globs/notebooks/wrong_file.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Databricks notebook source | ||
| # this file should never be used, because glob points to a different file |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
|
|
||
| >>> [CLI] bundle validate --output json | ||
| { | ||
| "resources": { | ||
| "pipelines": { | ||
| "nyc_taxi_pipeline": { | ||
| "deployment": { | ||
| "kind": "BUNDLE", | ||
| "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/pipeline_glob_paths/default/state/metadata.json" | ||
| }, | ||
| "libraries": [ | ||
| { | ||
| "notebook": { | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/pipeline_glob_paths/default/files/notebooks/nyc_taxi_loader" | ||
| } | ||
| }, | ||
| { | ||
| "file": { | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/pipeline_glob_paths/default/files/files/nyc_taxi_loader.py" | ||
| } | ||
| }, | ||
| { | ||
| "notebook": { | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/pipeline_glob_paths/default/files/notebooks/nyc_taxi_loader" | ||
| } | ||
| }, | ||
| { | ||
| "file": { | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/pipeline_glob_paths/default/files/files/nyc_taxi_loader.py" | ||
| } | ||
| }, | ||
| { | ||
| "notebook": { | ||
| "path": "/Workspace/Users/[USERNAME]/.bundle/pipeline_glob_paths/default/files/notebooks/nyc_taxi_loader" | ||
| } | ||
| }, | ||
| { | ||
| "maven": { | ||
| "coordinates": "org.jsoup:jsoup:1.7.2" | ||
| } | ||
| }, | ||
| { | ||
| "jar": "*/*.jar" | ||
| }, | ||
| { | ||
| "notebook": { | ||
| "path": "/Workspace/Users/me@company.com/*.ipynb" | ||
| } | ||
| }, | ||
| { | ||
| "notebook": { | ||
| "path": "s3://notebooks/*.ipynb" | ||
| } | ||
| } | ||
| ], | ||
| "permissions": [] | ||
| } | ||
| } | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
acceptance/bundle/paths/pipeline_globs/root/databricks.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| bundle: | ||
| name: pipeline_glob_paths | ||
|
|
||
| include: | ||
| - resources/pipeline.yml | ||
|
|
||
| variables: | ||
| notebook_dir: | ||
| description: Directory with DLT notebooks | ||
| default: notebooks | ||
| file_dir: | ||
| description: Directory with DLT files | ||
| default: files |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/paths/pipeline_globs/root/files/nyc_taxi_loader.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| print("Hello from file!") |
3 changes: 3 additions & 0 deletions
3
acceptance/bundle/paths/pipeline_globs/root/notebooks/nyc_taxi_loader.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Databricks notebook source | ||
|
|
||
| print("Hello from notebook!") |
1 change: 1 addition & 0 deletions
1
acceptance/bundle/paths/pipeline_globs/root/resources/files/wrong_file.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # this file should never be used, because glob points to a different file |
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/paths/pipeline_globs/root/resources/notebooks/wrong_file.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Databricks notebook source | ||
| # this file should never be used, because glob points to a different file |
18 changes: 18 additions & 0 deletions
18
acceptance/bundle/paths/pipeline_globs/root/resources/pipeline.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| resources: | ||
| pipelines: | ||
| nyc_taxi_pipeline: | ||
| libraries: | ||
| # globs for notebooks and files are expanded | ||
| - notebook: { path: "../${var.notebook_dir}/*" } | ||
| - file: { path: "../${var.file_dir}/*" } | ||
| # globs can include file extensions | ||
| - notebook: { path: "../${var.notebook_dir}/*.py" } | ||
| - file: { path: "../${var.file_dir}/*.py" } | ||
| # non-glob files work | ||
| - notebook: { path: "../${var.notebook_dir}/nyc_taxi_loader.py" } | ||
| # maven libraries and jars remain as-is | ||
| - maven: { coordinates: "org.jsoup:jsoup:1.7.2" } | ||
| - jar: "*/*.jar" | ||
| # absolute paths and paths using URLs remain as-is | ||
| - notebook: { path: "/Workspace/Users/me@company.com/*.ipynb" } | ||
| - notebook: { path: "s3://notebooks/*.ipynb" } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| cd root | ||
| trace $CLI bundle validate --output json | jq 'pick(.resources)' | ||
| rm -rf .databricks |
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.