-
Notifications
You must be signed in to change notification settings - Fork 350
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
feat: support new protobuf value param types for Pipeline Job client #797
Conversation
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.
Only two nitpicks, otherwise looking great!
Thank you!
raise TypeError("Got unknown type of value: {}".format(value)) | ||
|
||
return result | ||
# 'parameters' are deprecated in IR and changed to 'parameterValues'. |
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.
nit: same here, try reading parameterValues
first, then the old field as a fallback.
That would be more "efficient" going forward.
parameter_types = {k: v["type"] for k, v in parameter_input_definitions.items()} | ||
# 'type' is deprecated in IR and change to 'parameterType'. | ||
parameter_types = { | ||
k: v.get("type") or v.get("parameterType") |
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.
nit: usually we read the latest field first, and fallback to the deprecated field if the latest one not found.
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.
Great work! Thanks!
Note: The test will be uncommented when GAPIC library change for protobuf values is complete.