File tree Expand file tree Collapse file tree 8 files changed +146
-3
lines changed
pipelines/run/refresh-flags Expand file tree Collapse file tree 8 files changed +146
-3
lines changed Original file line number Diff line number Diff line change 1+ bundle :
2+ name : test-bundle-run-flags
3+
4+ resources :
5+ pipelines :
6+ my_pipeline :
7+ name : test-pipeline-flags
8+ libraries :
9+ - file :
10+ path : pipeline_file.py
Original file line number Diff line number Diff line change 1+ Local = true
2+ Cloud = false
3+
4+ [EnvMatrix ]
5+ DATABRICKS_CLI_DEPLOYMENT = [" terraform" , " direct-exp" ]
Original file line number Diff line number Diff line change 1+
2+ >>> [CLI] bundle deploy
3+ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle-run-flags/default/files...
4+ Deploying resources...
5+ Updating deployment state...
6+ Deployment complete!
7+
8+ === Running pipeline with --refresh flag and specific tables
9+ >>> [CLI] bundle run my_pipeline --refresh table1,table2
10+ Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
11+
12+
13+ >>> print_requests
14+ {
15+ "body": {
16+ "refresh_selection": [
17+ "table1",
18+ "table2"
19+ ]
20+ },
21+ "method": "POST",
22+ "path": "/api/2.0/pipelines/[UUID]/updates"
23+ }
24+
25+ === Running pipeline with --full-refresh-all flag
26+ >>> [CLI] bundle run my_pipeline --full-refresh-all
27+ Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
28+
29+
30+ >>> print_requests
31+ {
32+ "body": {
33+ "full_refresh": true
34+ },
35+ "method": "POST",
36+ "path": "/api/2.0/pipelines/[UUID]/updates"
37+ }
38+
39+ === Running pipeline with --full-refresh flag and specific tables
40+ >>> [CLI] bundle run my_pipeline --full-refresh table1,table2
41+ Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
42+
43+
44+ >>> print_requests
45+ {
46+ "body": {
47+ "full_refresh_selection": [
48+ "table1",
49+ "table2"
50+ ]
51+ },
52+ "method": "POST",
53+ "path": "/api/2.0/pipelines/[UUID]/updates"
54+ }
55+
56+ === Running pipeline with --full-refresh flag and --refresh flag
57+ >>> [CLI] bundle run my_pipeline --full-refresh table1,table2 --refresh table3,table4
58+ Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
59+
60+
61+ >>> print_requests
62+ {
63+ "body": {
64+ "full_refresh_selection": [
65+ "table1",
66+ "table2"
67+ ],
68+ "refresh_selection": [
69+ "table3",
70+ "table4"
71+ ]
72+ },
73+ "method": "POST",
74+ "path": "/api/2.0/pipelines/[UUID]/updates"
75+ }
Original file line number Diff line number Diff line change 1+ import dlt
2+ from pyspark .sql import SparkSession
3+
4+
5+ @dlt .table
6+ def my_table ():
7+ return spark .range (10 )
Original file line number Diff line number Diff line change 1+ print_requests() {
2+ jq --sort-keys 'select(.method != "GET" and (.path | contains("/pipelines")))' < out.requests.txt
3+ rm out.requests.txt
4+ }
5+
6+ trace $CLI bundle deploy
7+ rm out.requests.txt
8+
9+ title "Running pipeline with --refresh flag and specific tables"
10+ trace $CLI bundle run my_pipeline --refresh table1,table2
11+ trace print_requests
12+
13+ title "Running pipeline with --full-refresh-all flag"
14+ trace $CLI bundle run my_pipeline --full-refresh-all
15+ trace print_requests
16+
17+ title "Running pipeline with --full-refresh flag and specific tables"
18+ trace $CLI bundle run my_pipeline --full-refresh table1,table2
19+ trace print_requests
20+
21+ title "Running pipeline with --full-refresh flag and --refresh flag"
22+ trace $CLI bundle run my_pipeline --full-refresh table1,table2 --refresh table3,table4
23+ trace print_requests
Original file line number Diff line number Diff line change 1+ RecordRequests = true
Original file line number Diff line number Diff line change @@ -52,3 +52,24 @@ Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
5252 "method": "POST",
5353 "path": "/api/2.0/pipelines/[UUID]/updates"
5454}
55+
56+ === Running pipeline with --full-refresh flag and --refresh flag
57+ >>> [PIPELINES] run --full-refresh table1,table2 --refresh table3,table4
58+ Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
59+
60+
61+ >>> print_requests
62+ {
63+ "body": {
64+ "full_refresh_selection": [
65+ "table1",
66+ "table2"
67+ ],
68+ "refresh_selection": [
69+ "table3",
70+ "table4"
71+ ]
72+ },
73+ "method": "POST",
74+ "path": "/api/2.0/pipelines/[UUID]/updates"
75+ }
Original file line number Diff line number Diff line change @@ -7,16 +7,17 @@ trace $PIPELINES deploy
77rm out.requests.txt
88
99title "Running pipeline with --refresh flag and specific tables"
10- # Should refresh only the specified tables
1110trace $PIPELINES run --refresh table1,table2
1211trace print_requests
1312
1413title "Running pipeline with --full-refresh-all flag"
15- # Should have full refresh set to true
1614trace $PIPELINES run --full-refresh-all
1715trace print_requests
1816
1917title "Running pipeline with --full-refresh flag and specific tables"
20- # Should reset and recompute only the specified tables
2118trace $PIPELINES run --full-refresh table1,table2
2219trace print_requests
20+
21+ title "Running pipeline with --full-refresh flag and --refresh flag"
22+ trace $PIPELINES run --full-refresh table1,table2 --refresh table3,table4
23+ trace print_requests
You can’t perform that action at this time.
0 commit comments