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 7880a4c commit da94d72
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions python_modules/dagster/dagster/_core/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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.


Expand Down

0 comments on commit da94d72

Please sign in to comment.