Skip to content

Making the dataflow temp_location argument optional#615

Closed
zoyahav wants to merge 4 commits intoapache:python-sdkfrom
zoyahav:python-sdk
Closed

Making the dataflow temp_location argument optional#615
zoyahav wants to merge 4 commits intoapache:python-sdkfrom
zoyahav:python-sdk

Conversation

@zoyahav
Copy link

@zoyahav zoyahav commented Jul 8, 2016

Making the dataflow temp_location argument optional in the python SDK to match the java SDK.

@zoyahav
Copy link
Author

zoyahav commented Jul 8, 2016

Hi @aaltay and @silviulica, can you please take a look?

@aaltay
Copy link
Member

aaltay commented Jul 8, 2016

@dhalperi Dan, do you know why Travis run status is not shown in this page? I found the corresponding run at https://travis-ci.org/apache/incubator-beam/builds/143447856

@dhalperi
Copy link
Contributor

dhalperi commented Jul 8, 2016

I do not know -- Github. Travis. Stuff.

@dhalperi
Copy link
Contributor

dhalperi commented Jul 8, 2016

But the build hasn't started yet, so I'm not super surprised...

default=None,
help='GCS path for staging code packages needed by '
'workers.')
# Remote execution must check that this option is not None.
Copy link
Member

Choose a reason for hiding this comment

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

Remote execution comment can stay. Since temp_location may still be None if staging_location is None.

And the new comment could be written without referencing Dataflow. (e.g. "If temp_location is not set, it defaults to staging_location.")

Copy link
Author

Choose a reason for hiding this comment

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

Done. PTAL?

return validator

test_cases = [
{'temp_location': None, 'errors': ['temp_location']},
Copy link
Member

Choose a reason for hiding this comment

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

This test matrix needs to be extended with a few staging_location, temp_location mixed inputs. Because there is a dependency between them now.

Copy link
Author

Choose a reason for hiding this comment

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

This dependency doesn't exist in pipline_options_validator though, is there another test suit where I can add such a test?

Copy link
Member

Choose a reason for hiding this comment

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

No, we don't have another test suite. I expect these to happen:

staging_location: valid, temp_location: None -> no errors
staging_location: invalid, temp_location: None -> staging location invalid error
staging_location: None, temp_location: None -> Error for missing arguments staging_location and temp_location

The validator already checks whether temp_location is None or not. It is doing one thing when it is not None. If it is None, it can check whether staging_location is set or not. If not could warn that these two options are missing.

Copy link
Author

Choose a reason for hiding this comment

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

Good point, I've added this validation and some more test cases, PTAL.

@aaltay
Copy link
Member

aaltay commented Jul 9, 2016

Thank you @zoyahav. This LGTM. Let's wait for @silviulica to review before merging.

@silviulica
Copy link
Contributor

LGTM - Thanks!

asfgit pushed a commit that referenced this pull request Jul 11, 2016
@dhalperi
Copy link
Contributor

Merged. Please manually close the PR, @zoyahav

@zoyahav
Copy link
Author

zoyahav commented Jul 11, 2016

Great, thanks for the reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants