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

table_constraints has no setter? #1990

Open
roy-work opened this issue Aug 9, 2024 · 0 comments
Open

table_constraints has no setter? #1990

roy-work opened this issue Aug 9, 2024 · 0 comments
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API.

Comments

@roy-work
Copy link

roy-work commented Aug 9, 2024

AFAICT, it does not seem possible to create a table with the Python library, as table_constraints is inexplicably unsettable. (You can't, AFAICT, create PK/FK constraints via the Console, either, so I am beginning to wonder how one does make use of this feature.)

Environment details

  • OS type and version: macOS 14.5
  • Python version: python --version: Python 3.12.3
  • pip version: pip --version
    pip 24.0 from /usr/local/lib/python3.12/site-packages/pip (python 3.12)
    
  • google-cloud-bigquery version: pip show google-cloud-bigquery
    Name: google-cloud-bigquery
    Version: 3.25.0
    Summary: Google BigQuery API client library
    Home-page: https://github.com/googleapis/python-bigquery
    Author: Google LLC
    Author-email: googleapis-packages@google.com
    License: Apache 2.0
    Location: <snip>
    Requires: google-api-core, google-auth, google-cloud-core, google-resumable-media, packaging, python-dateutil, requests
    Required-by:
    

Steps to reproduce

  1. Attempt to create a table w/ a primary key or FK
  2. Run into trouble.

Code example

Where a_bq_table is a Table, and constraints is a TableConstraints

In [72]: a_bq_table.table_constraints = constraints
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[72], line 1
----> 1 a_bq_table.table_constraints = constraints

AttributeError: property 'table_constraints' of 'Table' object has no setter

Stack trace

N/A

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Aug 9, 2024
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.
Projects
None yet
Development

No branches or pull requests

2 participants