Skip to content

Commit

Permalink
Use LoadingContextForTest
Browse files Browse the repository at this point in the history
  • Loading branch information
briantu committed Oct 22, 2024
1 parent da94d72 commit 45d68da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions python_modules/dagster/dagster/_core/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ def instance(self) -> "DagsterInstance":
def loaders(self) -> Dict[Type, Tuple[DataLoader, BlockingDataLoader]]:
raise NotImplementedError()

@staticmethod
def ephemeral(instance: "DagsterInstance") -> "LoadingContext":
return LoadingContextForTest(instance)

def get_loaders_for(
self, ttype: Type["InstanceLoadableBy"]
) -> Tuple[DataLoader, BlockingDataLoader]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
from dagster._core.execution.plan.objects import StepFailureData, StepSuccessData
from dagster._core.execution.stats import StepEventStatus
from dagster._core.instance import RUNLESS_JOB_NAME, RUNLESS_RUN_ID
from dagster._core.loader import LoadingContext
from dagster._core.loader import LoadingContextForTest
from dagster._core.remote_representation.external_data import PartitionsSnap
from dagster._core.remote_representation.origin import (
InProcessCodeLocationOrigin,
Expand Down Expand Up @@ -6025,7 +6025,7 @@ def test_get_updated_asset_status_cache_values(
}

assert storage.get_asset_status_cache_values(
partition_defs_by_key, LoadingContext.ephemeral(instance)
partition_defs_by_key, LoadingContextForTest(instance)
) == [
None,
None,
Expand All @@ -6043,7 +6043,7 @@ def test_get_updated_asset_status_cache_values(
partition_defs = list(partition_defs_by_key.values())
for i, value in enumerate(
storage.get_asset_status_cache_values(
partition_defs_by_key, LoadingContext.ephemeral(instance)
partition_defs_by_key, LoadingContextForTest(instance)
),
):
assert value is not None
Expand Down

0 comments on commit 45d68da

Please sign in to comment.