Skip to content
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: add support dataset.max_time_travel_hours #1683

Merged
merged 6 commits into from
Oct 31, 2023

Conversation

Gaurang033
Copy link
Contributor

Fixes #1637

@google-cla
Copy link

google-cla bot commented Oct 17, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Oct 17, 2023
@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 18, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 18, 2023
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Oct 20, 2023
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Oct 20, 2023
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Oct 29, 2023
@Gaurang033
Copy link
Contributor Author

@Linchin added units tests.

@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 30, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 30, 2023
@max_time_travel_hours.setter
def max_time_travel_hours(self, hours):
if not isinstance(hours, int):
raise ValueError("Pass the int value")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: make the error message a little clearer such as saying f"max_time_travel_hours must be an integer. Got {hour}.".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Linchin done and added a unit tests for that as well.

tests/system/test_client.py Show resolved Hide resolved
return cls(role, entity_type, entity_id)
config = cls(role, entity_type, entity_id)
config._properties = copy.deepcopy(resource)
return config
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please explain why this change is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Linchin this function should not be changed. Thanks for catching it. I reverted it back.

@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 31, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 31, 2023
@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 31, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 31, 2023
tests/unit/test_create_dataset.py Outdated Show resolved Hide resolved
tests/unit/test_create_dataset.py Outdated Show resolved Hide resolved
google/cloud/bigquery/dataset.py Outdated Show resolved Hide resolved
@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 31, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 31, 2023
@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 31, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 31, 2023
@Linchin
Copy link
Contributor

Linchin commented Oct 31, 2023

Thank you @Gaurang033!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for setting max_time_travel_hours when creating a dataset
3 participants