-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-52511][SDP] Support dry-run mode in spark-pipelines command #51489
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f8aec6f
dry run
sryza 143fdd4
add Python end to end test
sryza 9e0dd6f
fix lint
sryza 5a00043
cli fix
sryza 8f5c457
Merge remote-tracking branch 'apache/master' into dry-run
sryza 5956c54
fix refresh tests after merge conflict
sryza 63282a0
fix test_spark_connect after merge conflict
sryza 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -217,7 +217,7 @@ def change_dir(path: Path) -> Generator[None, None, None]: | |
| os.chdir(prev) | ||
|
|
||
|
|
||
| def run(spec_path: Path) -> None: | ||
| def run(spec_path: Path, dry: bool) -> None: | ||
| """Run the pipeline defined with the given spec.""" | ||
| log_with_curr_timestamp(f"Loading pipeline spec from {spec_path}...") | ||
| spec = load_pipeline_spec(spec_path) | ||
|
|
@@ -242,7 +242,7 @@ def run(spec_path: Path) -> None: | |
| register_definitions(spec_path, registry, spec) | ||
|
|
||
| log_with_curr_timestamp("Starting run...") | ||
| result_iter = start_run(spark, dataflow_graph_id) | ||
| result_iter = start_run(spark, dataflow_graph_id, dry=dry) | ||
| try: | ||
| handle_pipeline_events(result_iter) | ||
| finally: | ||
|
|
@@ -257,6 +257,13 @@ def run(spec_path: Path) -> None: | |
| run_parser = subparsers.add_parser("run", help="Run a pipeline.") | ||
| run_parser.add_argument("--spec", help="Path to the pipeline spec.") | ||
|
|
||
| # "dry-run" subcommand | ||
| run_parser = subparsers.add_parser( | ||
| "dry-run", | ||
| help="Launch a run that just validates the graph and checks for errors.", | ||
| ) | ||
| run_parser.add_argument("--spec", help="Path to the pipeline spec.") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to be added mistakenly. Please remove this duplication because we already have this at line 258, @sryza . 😄
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for catching – just fixed |
||
|
|
||
| # "init" subcommand | ||
| init_parser = subparsers.add_parser( | ||
| "init", | ||
|
|
@@ -270,9 +277,9 @@ def run(spec_path: Path) -> None: | |
| ) | ||
|
|
||
| args = parser.parse_args() | ||
| assert args.command in ["run", "init"] | ||
| assert args.command in ["run", "dry-run", "init"] | ||
|
|
||
| if args.command == "run": | ||
| if args.command in ["run", "dry-run"]: | ||
| if args.spec is not None: | ||
| spec_path = Path(args.spec) | ||
| if not spec_path.is_file(): | ||
|
|
@@ -283,6 +290,6 @@ def run(spec_path: Path) -> None: | |
| else: | ||
| spec_path = find_pipeline_spec(Path.cwd()) | ||
|
|
||
| run(spec_path=spec_path) | ||
| run(spec_path=spec_path, dry=(args.command == "dry-run")) | ||
| elif args.command == "init": | ||
| init(args.name) | ||
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 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
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.
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.
@sryza shall we have an end-to-end test for the dry run mode? We should check that it can detect failures without side effects.
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.
Sure thing – just added, in test_spark_connect.py