@@ -2385,7 +2385,7 @@ def test_update_table(self):
23852385 "resourceTags" : {"123456789012/key" : "value" },
23862386 }
23872387 conn .api_request .assert_called_once_with (
2388- method = "PATCH" , data = sent , path = "/" + path , timeout = 7.5
2388+ method = "PATCH" , data = sent , path = "/" + path , timeout = 7.5 , query_params = {}
23892389 )
23902390 self .assertEqual (updated_table .description , table .description )
23912391 self .assertEqual (updated_table .friendly_name , table .friendly_name )
@@ -2439,6 +2439,7 @@ def test_update_table_w_custom_property(self):
24392439 path = "/%s" % path ,
24402440 data = {"newAlphaProperty" : "unreleased property" },
24412441 timeout = DEFAULT_TIMEOUT ,
2442+ query_params = {},
24422443 )
24432444 self .assertEqual (
24442445 updated_table ._properties ["newAlphaProperty" ], "unreleased property"
@@ -2475,6 +2476,7 @@ def test_update_table_only_use_legacy_sql(self):
24752476 path = "/%s" % path ,
24762477 data = {"view" : {"useLegacySql" : True }},
24772478 timeout = DEFAULT_TIMEOUT ,
2479+ query_params = {},
24782480 )
24792481 self .assertEqual (updated_table .view_use_legacy_sql , table .view_use_legacy_sql )
24802482
@@ -2567,9 +2569,10 @@ def test_update_table_w_query(self):
25672569 "schema" : schema_resource ,
25682570 },
25692571 timeout = DEFAULT_TIMEOUT ,
2572+ query_params = {},
25702573 )
25712574
2572- def test_update_table_w_schema_None (self ):
2575+ def test_update_table_w_schema_None_autodetect_schema (self ):
25732576 # Simulate deleting schema: not sure if back-end will actually
25742577 # allow this operation, but the spec says it is optional.
25752578 path = "projects/%s/datasets/%s/tables/%s" % (
@@ -2611,7 +2614,9 @@ def test_update_table_w_schema_None(self):
26112614 with mock .patch (
26122615 "google.cloud.bigquery.opentelemetry_tracing._get_final_span_attributes"
26132616 ) as final_attributes :
2614- updated_table = client .update_table (table , ["schema" ])
2617+ updated_table = client .update_table (
2618+ table , ["schema" ], autodetect_schema = True
2619+ )
26152620
26162621 final_attributes .assert_called_once_with (
26172622 {"path" : "/%s" % path , "fields" : ["schema" ]}, client , None
@@ -2623,6 +2628,7 @@ def test_update_table_w_schema_None(self):
26232628 sent = {"schema" : {"fields" : None }}
26242629 self .assertEqual (req [1 ]["data" ], sent )
26252630 self .assertEqual (req [1 ]["path" ], "/%s" % path )
2631+ self .assertEqual (req [1 ]["query_params" ], {"autodetect_schema" : True })
26262632 self .assertEqual (len (updated_table .schema ), 0 )
26272633
26282634 def test_update_table_delete_property (self ):
0 commit comments