Skip to content

Commit cc42389

Browse files
authored
Use TableSchema in BigQuery Column List (#1293)
* use table schema instead of query * airmeet not passing ruff * revert airmeet to head
1 parent c798aff commit cc42389

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

parsons/google/google_bigquery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,9 +1194,9 @@ def get_columns_list(self, schema: str, table_name: str) -> list:
11941194
A list of column names
11951195
"""
11961196

1197-
first_row = self.query(f"SELECT * FROM {schema}.{table_name} LIMIT 1;")
1197+
table_ref = self.client.get_table(table=f"{schema}.{table_name}")
11981198

1199-
return [x for x in first_row.columns]
1199+
return [schema_ref.name for schema_ref in table_ref.schema]
12001200

12011201
def get_row_count(self, schema: str, table_name: str) -> int:
12021202
"""

0 commit comments

Comments
 (0)