diff --git a/bigquery_etl/cli/query.py b/bigquery_etl/cli/query.py index 1e19fd2f2e..a96bce4778 100644 --- a/bigquery_etl/cli/query.py +++ b/bigquery_etl/cli/query.py @@ -935,7 +935,7 @@ def _run_query( logging.error(e) sys.exit(1) except FileNotFoundError: - logging.warning("No metadata.yaml found for {}", query_file) + logging.warning("No metadata.yaml found for %s", query_file) if not use_public_table and destination_table is not None: # destination table was parsed by argparse, however if it wasn't modified to diff --git a/bigquery_etl/public_data/publish_json.py b/bigquery_etl/public_data/publish_json.py index 8a3d80c572..b297e869c6 100644 --- a/bigquery_etl/public_data/publish_json.py +++ b/bigquery_etl/public_data/publish_json.py @@ -79,7 +79,7 @@ class JsonPublisher: self.table = query_file_re.group(2) self.version = query_file_re.group(3) else: - logging.error("Invalid file naming format: {}", self.query_file) + logging.error("Invalid file naming format: %s", self.query_file) sys.exit(1) def _clear_stage_directory(self): diff --git a/tests/test_entrypoint.py b/tests/test_entrypoint.py index 2f05d8cd05..cf740c2235 100644 --- a/tests/test_entrypoint.py +++ b/tests/test_entrypoint.py @@ -31,12 +31,12 @@ class TestEntrypoint: b"+---+-----+\n| a | b |\n+---+-----+\n| 1 | abc |\n+---+-----+\n" in result ) - assert b"No metadata.yaml found for {}" in result + assert b"No metadata.yaml found for " in result except subprocess.CalledProcessError as e: # running bq in CircleCI will fail since it's not installed # but the error output can be checked for whether bq was called assert b"No such file or directory: 'bq'" in e.output - assert b"No metadata.yaml found for {}" in e.output + assert b"No metadata.yaml found for " in e.output assert ( b'subprocess.check_call(["bq"] + query_arguments, stdin=query_stream)' in e.output @@ -72,12 +72,12 @@ class TestEntrypoint: b"+---+---+---+\n| a | b | c |\n+---+---+---+\n| a | b | c |\n+---+---+---+" in result ) - assert b"No metadata.yaml found for {}" in result + assert b"No metadata.yaml found for " in result except subprocess.CalledProcessError as e: # running bq in CircleCI will fail since it's not installed # but the error output can be checked for whether bq was called assert b"No such file or directory: 'bq'" in e.output - assert b"No metadata.yaml found for {}" in e.output + assert b"No metadata.yaml found for " in e.output assert ( b'subprocess.check_call(["bq"] + query_arguments, stdin=query_stream)' in e.output @@ -113,7 +113,7 @@ class TestEntrypoint: stderr=subprocess.STDOUT, ) assert b"Current status: DONE" in result - assert b"No metadata.yaml found for {}" in result + assert b"No metadata.yaml found for " in result result = bigquery_client.query( f"SELECT a FROM {project_id}.{temporary_dataset}.query_v1" @@ -123,7 +123,7 @@ class TestEntrypoint: assert row.a == "foo" except subprocess.CalledProcessError as e: assert b"No such file or directory: 'bq'" in e.output - assert b"No metadata.yaml found for {}" in e.output + assert b"No metadata.yaml found for " in e.output assert ( b'subprocess.check_call(["bq"] + query_arguments, stdin=query_stream)' in e.output