@@ -5384,6 +5384,31 @@ def test_insert_rows_json_w_explicit_none_insert_ids(self):
53845384 timeout = None ,
53855385 )
53865386
5387+ def test_insert_rows_w_wrong_arg (self ):
5388+ from google .cloud .bigquery .dataset import DatasetReference
5389+ from google .cloud .bigquery .schema import SchemaField
5390+ from google .cloud .bigquery .table import Table
5391+
5392+ PROJECT = "PROJECT"
5393+ DS_ID = "DS_ID"
5394+ TABLE_ID = "TABLE_ID"
5395+ ROW = {"full_name" : "Bhettye Rhubble" , "age" : "27" , "joined" : None }
5396+
5397+ creds = _make_credentials ()
5398+ client = self ._make_one (project = PROJECT , credentials = creds , _http = object ())
5399+ client ._connection = make_connection ({})
5400+
5401+ table_ref = DatasetReference (PROJECT , DS_ID ).table (TABLE_ID )
5402+ schema = [
5403+ SchemaField ("full_name" , "STRING" , mode = "REQUIRED" ),
5404+ SchemaField ("age" , "INTEGER" , mode = "REQUIRED" ),
5405+ SchemaField ("joined" , "TIMESTAMP" , mode = "NULLABLE" ),
5406+ ]
5407+ table = Table (table_ref , schema = schema )
5408+
5409+ with self .assertRaises (TypeError ):
5410+ client .insert_rows_json (table , ROW )
5411+
53875412 def test_list_partitions (self ):
53885413 from google .cloud .bigquery .table import Table
53895414
0 commit comments