mozilla / bigquery-etl

Bigquery ETL
https://mozilla.github.io/bigquery-etl
Mozilla Public License 2.0
253 stars 100 forks source link

Fix setting partitioning metadata #5690

Closed scholtzan closed 4 months ago

scholtzan commented 4 months ago

This should fix the errors we are seeing in Airflow:

[2024-05-30, 18:00:03 UTC] {pod_manager.py:466} INFO - [base]     changed = _update_query_schema(
[2024-05-30, 18:00:03 UTC] {pod_manager.py:466} INFO - [base]               ^^^^^^^^^^^^^^^^^^^^^
[2024-05-30, 18:00:03 UTC] {pod_manager.py:466} INFO - [base]   File "/app/bigquery_etl/cli/query.py", line 2008, in _update_query_schema
[2024-05-30, 18:00:03 UTC] {pod_manager.py:466} INFO - [base]     metadata.set_bigquery_clustering(table.clustering_fields)
[2024-05-30, 18:00:03 UTC] {pod_manager.py:466} INFO - [base]   File "/app/bigquery_etl/metadata/parse_metadata.py", line 432, in set_bigquery_clustering
[2024-05-30, 18:00:03 UTC] {pod_manager.py:466} INFO - [base]     time_partitioning=time_partitioning,
[2024-05-30, 18:00:03 UTC] {pod_manager.py:466} INFO - [base]                       ^^^^^^^^^^^^^^^^^
2024-05-30T18:00:03.709365151Z 
[2024-05-30, 18:00:03 UTC] {pod_manager.py:466} INFO - [base] UnboundLocalError: cannot access local variable 'time_partitioning' where it is not associated with a value

Checklist for reviewer:

For modifications to schemas in restricted namespaces (see CODEOWNERS):

┆Issue is synchronized with this Jira Task