From 0468067bcc85c1305d906773440e07826ddd240c Mon Sep 17 00:00:00 2001 From: Walt Askew Date: Wed, 20 Jul 2022 20:53:35 +0000 Subject: [PATCH] feat: Add More Specific Type Annotations for Row Dictionaries The keys must be strings as they represent column names. Update type annotations to reflect this. --- google/cloud/bigquery/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/google/cloud/bigquery/client.py b/google/cloud/bigquery/client.py index 1200d78f9..b72505a15 100644 --- a/google/cloud/bigquery/client.py +++ b/google/cloud/bigquery/client.py @@ -3349,10 +3349,10 @@ def query( def insert_rows( self, table: Union[Table, TableReference, str], - rows: Union[Iterable[Tuple], Iterable[Dict]], + rows: Union[Iterable[Tuple], Iterable[Mapping[str, Any]]], selected_fields: Sequence[SchemaField] = None, **kwargs, - ) -> Sequence[dict]: + ) -> Sequence[Dict[str, Any]]: """Insert rows into a table via the streaming API. See @@ -3470,7 +3470,7 @@ def insert_rows_from_dataframe( def insert_rows_json( self, table: Union[Table, TableReference, TableListItem, str], - json_rows: Sequence[Dict], + json_rows: Sequence[Mapping[str, Any]], row_ids: Union[ Iterable[Optional[str]], AutoRowIDs, None ] = AutoRowIDs.GENERATE_UUID,