Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display bigquery subfield of record as schema. #6522

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions redash/query_runner/big_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@
datasets = self._get_project_datasets(project_id)

query_base = """
SELECT table_schema, table_name, column_name
FROM `{dataset_id}`.INFORMATION_SCHEMA.COLUMNS
SELECT table_schema, table_name, field_path
FROM `{dataset_id}`.INFORMATION_SCHEMA.COLUMN_FIELD_PATHS
WHERE table_schema NOT IN ('information_schema')
"""

Expand All @@ -323,7 +323,7 @@
table_name = "{0}.{1}".format(row["table_schema"], row["table_name"])
if table_name not in schema:
schema[table_name] = {"name": table_name, "columns": []}
schema[table_name]["columns"].append(row["column_name"])
schema[table_name]["columns"].append(row["field_path"])

Check warning on line 326 in redash/query_runner/big_query.py

View check run for this annotation

Codecov / codecov/patch

redash/query_runner/big_query.py#L326

Added line #L326 was not covered by tests

return list(schema.values())

Expand Down
Loading