From da94d727bbbb68f887e727f6ea1db1199ba54d3c Mon Sep 17 00:00:00 2001 From: briantu Date: Mon, 21 Oct 2024 18:30:00 -0400 Subject: [PATCH] Use LoadingContextForTest --- python_modules/dagster/dagster/_core/loader.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/python_modules/dagster/dagster/_core/loader.py b/python_modules/dagster/dagster/_core/loader.py index 9853d3bb4dedc..adec5e3084d95 100644 --- a/python_modules/dagster/dagster/_core/loader.py +++ b/python_modules/dagster/dagster/_core/loader.py @@ -60,7 +60,7 @@ def loaders(self) -> Dict[Type, Tuple[DataLoader, BlockingDataLoader]]: @staticmethod def ephemeral(instance: "DagsterInstance") -> "LoadingContext": - return EphemeralLoadingContext(instance) + return LoadingContextForTest(instance) def get_loaders_for( self, ttype: Type["InstanceLoadableBy"] @@ -84,22 +84,6 @@ def clear_loaders(self) -> None: del self.loaders[ttype] -class EphemeralLoadingContext(LoadingContext): - """Loading context that can be constructed for short-lived method resolution.""" - - def __init__(self, instance: "DagsterInstance"): - self._instance = instance - self._loaders = {} - - @property - def instance(self) -> "DagsterInstance": - return self._instance - - @property - def loaders(self) -> Dict[Type, Tuple[DataLoader, BlockingDataLoader]]: - return self._loaders - - # Expected there may be other "Loadable" base classes based on what is needed to load.