-
Notifications
You must be signed in to change notification settings - Fork 308
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
fix: adding property setter for table constraints, #1990 #2092
base: main
Are you sure you want to change the base?
fix: adding property setter for table constraints, #1990 #2092
Conversation
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. |
Thank you @lkhagvadorj-amp for making the contribution! The PR looks great, but could you do the following things so we can merge it:
Thanks again and happy holidays! |
@Linchin Happy to contribute and thank you for the initial review! I’ve pushed the testing changes—would be grateful if you could review them again. Happy holidays! |
api_repr = value | ||
if isinstance(value, TableConstraints): | ||
api_repr = value.to_api_repr() | ||
elif value is not None: |
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.
We also need to add a unit test for this branch.
Thank you @lkhagvadorj-amp, I ran the test again, but it seems we need to fix several tests. I'm sorry that I have to trigger the presubmit tests manually, but you can run the system test locally by |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #1990 🦕
Overview
This pull request introduces enhancements to the
google/cloud/bigquery/table.py
file by adding setter methods and conversion functions. Additionally, a new unit test is added to ensure the functionality of the new setter method.Enhancements to
google/cloud/bigquery/table.py
:table_constraints
to allow setting primary key and foreign key information.to_api_repr
method to theForeignKey
class to return a dictionary representation of the object.to_api_repr
method to theTableConstraints
class to return a dictionary representation of the object.Unit tests:
table_constraints
property setter to ensure it correctly updates the table properties.