Skip to content

fix: make args optional#521

Merged
SurferJeffAtGoogle merged 2 commits intogoogleapis:masterfrom
summer-ji-eng:fix_args_optional
May 5, 2020
Merged

fix: make args optional#521
SurferJeffAtGoogle merged 2 commits intogoogleapis:masterfrom
summer-ji-eng:fix_args_optional

Conversation

@summer-ji-eng
Copy link
Copy Markdown
Contributor

multiple version needs two args: versions and defualt_version:
it should be the optional arguments, but previous code throw keyError

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 4, 2020
Copy link
Copy Markdown
Contributor

@alexander-fenster alexander-fenster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I'd like someone with Python background to take a look (@SurferJeffAtGoogle? :) )

Comment thread synthtool/gcp/common.py

# generate root-level `src/index.ts` to export multiple versions and its default clients
if kwargs["versions"] and kwargs["default_version"]:
if "versions" in kwargs and "default_version" in kwargs:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echoing @alexander-fenster's comment, I'm not the best Python developer these days. This looks good to me, but could we add a test to confirm the behavior perhaps?

Copy link
Copy Markdown

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand if it's too much of a hassle to add a test to common, since we don't have a pattern for testing this yet.

I'll leave it up to you (depending on @SurferJeffAtGoogle's feedback).

@SurferJeffAtGoogle SurferJeffAtGoogle merged commit ea3ae39 into googleapis:master May 5, 2020
@summer-ji-eng summer-ji-eng deleted the fix_args_optional branch May 5, 2020 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants