googleapis / python-bigquery

Apache License 2.0
746 stars 306 forks source link

`table_constraints` has no setter? #1990

Open roy-work opened 3 months ago

roy-work commented 3 months ago

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

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