diff --git a/.circleci/config.yml b/.circleci/config.yml index 7ada82c3d0..14dee61473 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,7 +42,9 @@ jobs: - checkout - run: name: Verify that BigQuery validates each query - command: script/dryrun + command: | + pip install PyYaml + script/dryrun deploy: parameters: image: diff --git a/bigquery_etl/parse_metadata.py b/bigquery_etl/parse_metadata.py index 743af4aed8..711072afc3 100644 --- a/bigquery_etl/parse_metadata.py +++ b/bigquery_etl/parse_metadata.py @@ -76,7 +76,7 @@ class Metadata: @classmethod def of_sql_file(cls, sql_file): - """Returns the metadata that is associated with the provided SQL file.""" + """Return the metadata that is associated with the provided SQL file.""" path, _ = os.path.split(sql_file) metadata_file = os.path.join(path, METADATA_FILE) cls = Metadata.from_file(metadata_file) diff --git a/script/dryrun b/script/dryrun index 75ec973874..b8710dd902 100755 --- a/script/dryrun +++ b/script/dryrun @@ -97,8 +97,6 @@ USE_DERIVED_DATASETS = { } - - def worker_entrypoint(public_project, sqlfile): sql = open(sqlfile).read() if sqlfile in USE_DERIVED_DATASETS: @@ -114,7 +112,7 @@ def worker_entrypoint(public_project, sqlfile): metadata = Metadata.of_sql_file(sqlfile) if metadata.is_public_bigquery(): request_data["project"] = public_project - except Exception as e: + except Exception: # for all other queries perform dryrun in default project pass diff --git a/script/publish_public_data_views b/script/publish_public_data_views index 8c8ac79eb7..85ced475d3 100755 --- a/script/publish_public_data_views +++ b/script/publish_public_data_views @@ -46,7 +46,7 @@ parser.add_argument( def is_public_bigquery(metadata_file): """ - Reads the metadata file associated with the query to determine if the query + Reads the metadata file associated with the query to determine if the query results should be written into the public dataset. """ @@ -69,7 +69,7 @@ def generate_and_publish_view(client, project, dataset, table, public_project, d full_view_id = ".".join([project, dataset, table]) public_table = ".".join([public_project, dataset, table]) - view_sql = f"""CREATE OR REPLACE VIEW + view_sql = f"""CREATE OR REPLACE VIEW `{full_view_id}` AS SELECT * FROM `{public_table}` """