feat(PipelineJob): allow PipelineSpec as param#774
Merged
ji-yaqi merged 5 commits intogoogleapis:mainfrom Oct 19, 2021
Merged
Conversation
a31e745 to
80319e7
Compare
chensun
reviewed
Oct 18, 2021
| builder.update_pipeline_root(pipeline_root) | ||
| builder.update_runtime_parameters(parameter_values) | ||
| runtime_config_dict = builder.build() | ||
| if pipeline_spec_only: |
Member
There was a problem hiding this comment.
This can be covered by the else block. So you don't even need this flag.
Member
There was a problem hiding this comment.
Sorry I wasn't very clear with the last comment, I meant you could use PipelineRuntimeConfigBuilder.from_job_spec_json(pipeline_job) for both cases, something like:
if pipeline_json.get("pipelineSpec") is not None:
pipeline_job = pipeline_json
pipeline_root = ...
else:
pipeline_job = {"pipelineSpec": pipeline_json, "runtimeConfig": {}}
pipeline_root = ...
builder = pipeline_utils.PipelineRuntimeConfigBuilder.from_job_spec_json(pipeline_job)
builder.update_pipeline_root(pipeline_root)
builder.update_runtime_parameters(parameter_values)
runtime_config_dict = builder.build()
This will result shorter and cleaner code.
Member
|
/lgtm Thanks! |
chensun
approved these changes
Oct 19, 2021
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.