From 74b28e2ec0c7c56d6126e65c6d2a6525e4836acb Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 21 Oct 2024 10:59:45 -0700 Subject: [PATCH] Rename `patch_id_generators_helper` -> `id_number_space`. --- metricflow-semantics/metricflow_semantics/dag/sequential_id.py | 2 +- .../metricflow_semantics/test_helpers/id_helpers.py | 2 +- tests_metricflow/fixtures/manifest_fixtures.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metricflow-semantics/metricflow_semantics/dag/sequential_id.py b/metricflow-semantics/metricflow_semantics/dag/sequential_id.py index bf0f7f4666..01bbd71510 100644 --- a/metricflow-semantics/metricflow_semantics/dag/sequential_id.py +++ b/metricflow-semantics/metricflow_semantics/dag/sequential_id.py @@ -96,7 +96,7 @@ def reset(cls, default_start_value: int = 0) -> None: @classmethod @contextmanager - def patch_id_generators_helper(cls, start_value: int) -> Generator[None, None, None]: + def id_number_space(cls, start_value: int) -> Generator[None, None, None]: """Open a context where ID generation starts with the given start value. On exit, resume ID numbering from prior to entering the context. diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/id_helpers.py b/metricflow-semantics/metricflow_semantics/test_helpers/id_helpers.py index 8621b4c305..d54e57b052 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/id_helpers.py +++ b/metricflow-semantics/metricflow_semantics/test_helpers/id_helpers.py @@ -15,7 +15,7 @@ def patch_id_generators() -> Generator[None, None, None]: Plan outputs contain IDs, so if the IDs are not consistent from run to run, there will be diffs in the actual vs. expected outputs during a test. """ - with SequentialIdGenerator.patch_id_generators_helper(start_value=IdNumberSpace.for_test_start().start_value): + with SequentialIdGenerator.id_number_space(start_value=IdNumberSpace.for_test_start().start_value): yield None diff --git a/tests_metricflow/fixtures/manifest_fixtures.py b/tests_metricflow/fixtures/manifest_fixtures.py index f50948ae7d..7bcde44470 100644 --- a/tests_metricflow/fixtures/manifest_fixtures.py +++ b/tests_metricflow/fixtures/manifest_fixtures.py @@ -265,7 +265,7 @@ def mf_engine_test_fixture_mapping( """Returns a mapping for all semantic manifests used in testing to the associated test fixture.""" fixture_mapping: Dict[SemanticManifestSetup, MetricFlowEngineTestFixture] = {} for semantic_manifest_setup in SemanticManifestSetup: - with SequentialIdGenerator.patch_id_generators_helper(semantic_manifest_setup.id_number_space.start_value): + with SequentialIdGenerator.id_number_space(semantic_manifest_setup.id_number_space.start_value): fixture_mapping[semantic_manifest_setup] = MetricFlowEngineTestFixture.from_parameters( sql_client, load_semantic_manifest(semantic_manifest_setup.yaml_file_dir, template_mapping) )