Skip to content

Definitions

defs()

Returns set of definitions explicitly available and loadable by Dagster tools. Will be automatically dectectd and loaded by the load_defs function in the root definitions file.

@definitions decorator will provides lazy loading so that the assets are only instantiated when needed.

Source code in data_platform\defs\sling\definitions.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
@definitions
def defs() -> Definitions:
    """Returns set of definitions explicitly available and loadable by Dagster tools.
    Will be automatically dectectd and loaded by the load_defs function in the root
    definitions file.

    @definitions decorator will provides lazy loading so that the assets are only
    instantiated when needed.
    """
    from pathlib import Path

    from ...lib.sling import DagsterSlingFactory

    config_dir = Path(__file__).joinpath(*[".."], "sling").resolve()

    return DagsterSlingFactory.build_definitions(config_dir)