@@ -18,33 +18,28 @@ def list_all_tables() -> List[Optional[Table]]:
1818 for dataset in gbq .list_datasets ():
1919 for listed_table in gbq .list_tables (dataset .dataset_id ):
2020 table = get_table (
21- listed_table .project , listed_table .dataset_id , listed_table .table_id
21+ f" { listed_table .project } . { listed_table .dataset_id } . { listed_table .table_id } "
2222 )
2323 tables .append (table )
2424 return tables
2525
2626
27- def get_table (project_id : str , dataset_id : str , table_id : str ) -> Table :
27+ def get_table (full_table_id : str ) -> Table :
2828 """
2929 Get a single Google BigQuery table.
3030
31- :param project_id: Google Cloud project ID.
32- :type project_id: str
33- :param dataset_id: ID of Google BigQuery dataset.
34- :type dataset_id: str
35- :param table_id: ID of Google BigQuery table.
36- :type table_id: str
31+ :param full_table_id: Full ID of a Google BigQuery table.
32+ :type full_table_id: str
3733 :returns: Table
3834 """
3935 try :
40- full_table_id = f"{ project_id } .{ dataset_id } .{ table_id } "
4136 table = gbq .get_table (full_table_id )
42- LOGGER .info (f"{ dataset_id } .{ table_id } : { table .num_rows } rows." )
37+ LOGGER .info (f"{ table . dataset_id } .{ table . table_id } : { table .num_rows } rows." )
4338 return table
4439 except BadRequest as e :
45- LOGGER .error (f"Invalid GCP request when fetching table `{ table_id } `: { e } " )
40+ LOGGER .error (f"Invalid GCP request when fetching table `{ full_table_id } `: { e } " )
4641 except Exception as e :
47- LOGGER .error (f"Unexpected error when fetching table `{ table_id } `: { e } " )
42+ LOGGER .error (f"Unexpected error when fetching table `{ full_table_id } `: { e } " )
4843
4944
5045def get_table_schema (table : Table ) -> Sequence [Union [SchemaField , Mapping [str , Any ]]]:
0 commit comments