-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[cli-refactor] Standardize shared option groups (part 2) #27494
Conversation
12db08c
to
a5d50b1
Compare
740488a
to
bccb744
Compare
@@ -79,7 +81,7 @@ def job_cli(): | |||
name="list", | |||
help=f"List the jobs in a repository. {WORKSPACE_TARGET_WARNING}", | |||
) | |||
@job_repository_target_options |
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.
This was identical to @repository_options
, so it's been deleted.
a5d50b1
to
5d7ae2e
Compare
bccb744
to
10e3127
Compare
10e3127
to
0902df7
Compare
5d7ae2e
to
2ba5094
Compare
2ba5094
to
5ab09e4
Compare
) | ||
|
||
|
||
@validate_command_options |
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.
[1] validate_command_options
here is just an arbitrary subset of the full set of workspace options. AFAICT there is no reason for this, since we immediately resolve these options to a workspace using the common pathway inside the validate command. Therefore replace with standard workspace options.
generate_module_name_option(allow_multiple=True), | ||
generate_working_directory_option(), | ||
*generate_grpc_server_target_options(hidden=True), | ||
) |
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.
See [1].
5ab09e4
to
a58be30
Compare
a58be30
to
9c0b023
Compare
if kwargs.get("empty_workspace"): | ||
args.extend("--empty-workspace") |
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.
args.extend()
is being called with a string argument, which Python will iterate through character-by-character. To properly add the flag as a single argument, use either args.extend(['--empty-workspace'])
or args.extend(('--empty-workspace',))
.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
0b89790
to
97522d5
Compare
97522d5
to
175147a
Compare
Summary & Motivation
@repository_target_options
->@repository_options
). This was confusing since it didn't correspond to actual*Target*
classes in the code.@python_origin_target_options
->@python_pointer_options
. "pointer" was chosen because the Python pointer options mostly correspond (and are ultimately parsed to)CodePointer
objects.@python_job_config_option
->@run_config_option
. Another misleading name, as this was used outside the context of job config.dagster definitions validate
accepted--workspace
,--python-file
, and--module-name
but none of the other workspace-specifying options. There's no apparent reason for this, since the function resolves a workspace for validation. The inconsistency was likely the result of the original implementor just getting overwhelmed with the complexity of the code.How I Tested These Changes
Existing test suite.