Skip to content

Commit

Permalink
Append nanoseconds to dataset name in test_historical_retrival to pre…
Browse files Browse the repository at this point in the history
…vent tests stomping over each other (#1593)

* Append the python version to the dataset name in test_historical_retrival to prevent tests stomping over each other

Signed-off-by: Achal Shah <achals@gmail.com>

* make format

Signed-off-by: Achal Shah <achals@gmail.com>

* use version_info to avoid mucking wiht strings

Signed-off-by: Achal Shah <achals@gmail.com>

* time_ns followed by randint

Signed-off-by: Achal Shah <achals@gmail.com>

* fix lint

Signed-off-by: Achal Shah <achals@gmail.com>

* Use 1000-9999 for fixed width

Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals authored May 28, 2021
1 parent e451a11 commit f543871
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdk/python/tests/test_historical_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ def test_historical_features_from_bigquery_sources(
) = generate_entities(start_date, infer_event_timestamp_col)

# bigquery_dataset = "test_hist_retrieval_static"
bigquery_dataset = f"test_hist_retrieval_{int(time.time())}"
bigquery_dataset = (
f"test_hist_retrieval_{int(time.time_ns())}_{random.randint(1000, 9999)}"
)

with BigQueryDataSet(bigquery_dataset), TemporaryDirectory() as temp_dir:
gcp_project = bigquery.Client().project
Expand Down

0 comments on commit f543871

Please sign in to comment.