Skip to content

Commit

Permalink
Rename patch_id_generators_helper -> id_number_space.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Oct 21, 2024
1 parent ac645b5 commit 74b28e2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion tests_metricflow/fixtures/manifest_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down

0 comments on commit 74b28e2

Please sign in to comment.