Skip to content

Commit

Permalink
[module-loaders] Add docstring for load_definitions_from_module
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong committed Jan 10, 2025
1 parent 8b5c275 commit 8e089ff
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ def load_definitions_from_module(
loggers: Optional[Mapping[str, LoggerDefinition]] = None,
executor: Optional[Union[Executor, ExecutorDefinition]] = None,
) -> Definitions:
"""Constructs the :py:class:`dagster.Definitions` from the given module.
Args:
module (ModuleType): The Python module to look for :py:class:`dagster.Definitions` inside.
resources (Optional[Mapping[str, Any]]):
Dictionary of resources to bind to assets in the loaded :py:class:`dagster.Definitions`.
loggers (Optional[Mapping[str, LoggerDefinition]]):
Default loggers for jobs in the loaded :py:class:`dagster.Definitions`. Individual jobs
can define their own loggers by setting them explicitly.
executor (Optional[Union[Executor, ExecutorDefinition]]):
Default executor for jobs in the loaded :py:class:`dagster.Definitions`. Individual jobs
can define their own executors by setting them explicitly.
Returns:
Definitions:
The :py:class:`dagster.Definitions` defined in the given module.
"""
return load_definitions_from_modules(
modules=[module], resources=resources, loggers=loggers, executor=executor
)
Expand Down

0 comments on commit 8e089ff

Please sign in to comment.