diff --git a/docs/sphinx/sections/api/apidocs/definitions.rst b/docs/sphinx/sections/api/apidocs/definitions.rst index 13e27d1767161..029b40bceea3f 100644 --- a/docs/sphinx/sections/api/apidocs/definitions.rst +++ b/docs/sphinx/sections/api/apidocs/definitions.rst @@ -6,4 +6,6 @@ Definitions .. autoclass:: Definitions :members: get_job_def, get_sensor_def, get_schedule_def, load_asset_value, get_asset_value_loader -.. autofunction:: create_repository_using_definitions_args \ No newline at end of file +.. autofunction:: create_repository_using_definitions_args + +.. autofunction:: load_definitions_from_module \ No newline at end of file diff --git a/python_modules/dagster/dagster/__init__.py b/python_modules/dagster/dagster/__init__.py index 6d0a315104b04..1b3db8c5683be 100644 --- a/python_modules/dagster/dagster/__init__.py +++ b/python_modules/dagster/dagster/__init__.py @@ -309,6 +309,9 @@ load_assets_from_package_module as load_assets_from_package_module, load_assets_from_package_name as load_assets_from_package_name, ) +from dagster._core.definitions.module_loaders.load_defs_from_module import ( + load_definitions_from_module as load_definitions_from_module, +) from dagster._core.definitions.multi_asset_sensor_definition import ( MultiAssetSensorDefinition as MultiAssetSensorDefinition, MultiAssetSensorEvaluationContext as MultiAssetSensorEvaluationContext, diff --git a/python_modules/dagster/dagster/_core/definitions/module_loaders/load_defs_from_module.py b/python_modules/dagster/dagster/_core/definitions/module_loaders/load_defs_from_module.py index 2d39e67d5acf0..c35abaed93189 100644 --- a/python_modules/dagster/dagster/_core/definitions/module_loaders/load_defs_from_module.py +++ b/python_modules/dagster/dagster/_core/definitions/module_loaders/load_defs_from_module.py @@ -1,6 +1,7 @@ from types import ModuleType from typing import Any, Mapping, Optional, Union +from dagster._annotations import experimental from dagster._core.definitions.definitions_class import Definitions from dagster._core.definitions.executor_definition import ExecutorDefinition from dagster._core.definitions.logger_definition import LoggerDefinition @@ -8,6 +9,7 @@ from dagster._core.executor.base import Executor +@experimental def load_definitions_from_module( module: ModuleType, resources: Optional[Mapping[str, Any]] = None,