-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
python_modules/dagster/dagster/_core/definitions/module_loaders/load_defs_from_module.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from types import ModuleType | ||
from typing import Optional | ||
|
||
from dagster._core.definitions.definitions_class import Definitions | ||
from dagster._core.definitions.module_loaders.object_list import ModuleScopedDagsterObjects | ||
from dagster._core.definitions.module_loaders.utils import ( | ||
ExecutorObject, | ||
LoggerDefinitionKeyMapping, | ||
ResourceDefinitionMapping, | ||
) | ||
|
||
|
||
def load_definitions_from_module( | ||
module: ModuleType, | ||
resources: Optional[ResourceDefinitionMapping] = None, | ||
loggers: Optional[LoggerDefinitionKeyMapping] = None, | ||
executor: Optional[ExecutorObject] = None, | ||
) -> Definitions: | ||
return Definitions( | ||
**ModuleScopedDagsterObjects.from_modules([module]).get_object_list().to_definitions_args(), | ||
resources=resources, | ||
loggers=loggers, | ||
executor=executor, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters