API Reference¶
cfa_dagster
¶
cfa_dagster
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
module-attribute
¶
handler = logging.StreamHandler()
module-attribute
¶
log = logging.getLogger(__name__)
module-attribute
¶
log_level = getattr(logging, log_level_name, logging.INFO)
module-attribute
¶
log_level_name = os.environ.get('CFA_DAGSTER_LOG_LEVEL', 'INFO').upper()
module-attribute
¶
ADLS2FilesystemIOManager
¶
Bases: ConfigurableIOManager
An IOManager that stores directories and files on ADLS2.
Assets should return a local pathlib.Path pointing to either a file or a directory.
The IOManager will upload the file or directory to ADLS2 and make it available to
downstream assets.
Downstream assets receive a local pathlib.Path pointing to the downloaded file or
directory. If the downstream asset's type annotation is str, the ADLS2 path is
returned directly without downloading (e.g. abfss://container@account.dfs.core.windows.net/...).
Partitioned assets are fully supported. When loading multiple partitions, the downstream
asset receives a Dict[str, Path] mapping partition keys to local paths, consistent
with Dagster's built-in IOManager behavior.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
use_production
|
bool
|
whether to access production storage or user-specific development storage |
required |
max_concurrency
|
int
|
Number of parallel chunks per file transfer. Higher values
improve throughput for large files at the cost of memory. Defaults to |
required |
Example:
.. code-block:: python
from dagster import Definitions, asset
from pathlib import Path
@asset(io_manager_key="adls2_dir")
def my_asset() -> Path:
out = Path("/tmp/my_output")
out.mkdir(exist_ok=True)
(out / "results.csv").write_text("a,b,c")
return out
@asset(io_manager_key="adls2_dir")
def downstream_asset(my_asset: Path) -> None:
df = pd.read_csv(my_asset / "results.csv")
@asset(io_manager_key="adls2_dir")
def path_only_asset(my_asset: str) -> None:
# receives the raw ADLS2 path without downloading
print(my_asset) # abfss://container@account.dfs.core.windows.net/dagster/my_asset
defs = Definitions(
assets=[my_asset, downstream_asset, path_only_asset],
resources={
"adls2_dir": ADLS2FilesystemIOManager()
},
)
adls2: ResourceDependency[ADLS2Resource]
instance-attribute
¶
delete_after_upload: bool = Field(default=False, description='Whether files/directories should be deleted after upload.Default: False')
class-attribute
instance-attribute
¶
dry_run: bool = Field(default=False, description='If True, log actions but do not upload or download any files.')
class-attribute
instance-attribute
¶
input_mode: InputMode = Field(default='download', description="Mode to determine behavior on loading inputs from upstream. 'download': Download the file(s) from upstream, 'path': return an abfss:// formatted path, 'reference': return an ADLS2Path which includes an authenticated ADLS2 client.")
class-attribute
instance-attribute
¶
max_concurrency: int = Field(default=4, description='Number of parallel chunks per file transfer. Higher valuesimprove throughput for large files at the cost of memory. Defaults to `4`,which gives a good balance for files in the hundreds of MB to GB range.')
class-attribute
instance-attribute
¶
on_input_conflict: OnInputConflict = Field(default='overwrite', description="Behavior when the local download target already exists. 'overwrite': Overwrite existing files (default), 'fail': Raise an error if the local directory exists and is non-empty, 'warn': Log a warning and proceed with the download, 'skip': Log a warning and return the existing directory without downloading, 'merge': Download only files that don't already exist locally.")
class-attribute
instance-attribute
¶
overrides: dict[str, Any] = Field(description="Override an upstream dependency input with a configured value e.g.`upstream_asset: 'static_value_for_testing'`", default_factory=dict)
class-attribute
instance-attribute
¶
use_production: bool = Field(description='Whether to use the production storage account for IO', default=(is_production()))
class-attribute
instance-attribute
¶
handle_output(context: OutputContext, obj: Any) -> None
¶
load_input(context: InputContext) -> Any
¶
ADLS2Path
dataclass
¶
Represents a path in ADLS2.
This object provides authenticated access to the underlying Azure SDK clients while also exposing convenience methods for common operations.
Users can always drop down to the Azure SDK if they need functionality beyond the convenience methods.
Examples¶
Download entire asset:
local_dir = data.download()
Download only a subfolder:
parquet_dir = data.download("parquet")
Access Azure SDK directly:
directory_client = data.get_directory_client()
for item in directory_client.get_paths():
...
file_system_client: FileSystemClient
property
¶
local_dir: Path
instance-attribute
¶
uri: str
property
¶
__init__(_io_manager: FilesystemADLS2IOManager, _path: str, local_dir: Path) -> None
¶
download(relative_path: str | None = None, local_dir: Path | None = None, on_conflict: OnInputConflict = 'overwrite') -> Path
¶
Download this path or a subpath.
Examples¶
Download entire asset:
data.download()
Download parquet subdirectory:
data.download("parquet")
Download nested path:
data.download("parquet/2026/01")
get_directory_client() -> DataLakeDirectoryClient
¶
get_file_client() -> DataLakeFileClient
¶
list(recursive: bool = False)
¶
List paths beneath this ADLS location.
Returns Azure SDK PathProperties objects.
ADLS2PickleIOManager
¶
Bases: ConfigurableIOManager
Persistent IO manager using Azure Data Lake Storage Gen2 for storage.
Serializes objects via pickling. Suitable for objects storage for distributed executors, so long as each execution node has network connectivity and credentials for ADLS and the backing container.
Assigns each op output to a unique filepath containing run ID, step key, and output name.
Assigns each asset to a single filesystem path, at "
Subsequent materializations of an asset will overwrite previous materializations of that asset.
With a base directory of "/my/base/path", an asset with key
AssetKey(["one", "two", "three"]) would be stored in a file called "three" in a directory
with path "/my/base/path/one/two/".
Example usage:
- Attach this IO manager to a set of assets.
.. code-block:: python
from dagster import Definitions, asset
from cfa_dagster import ADLS2PickleIOManager
@asset
def asset1():
# create df ...
return df
@asset
def asset2(asset1):
return df[:5]
Definitions(
assets=[asset1, asset2],
resources={
"io_manager": ADLS2PickleIOManager(),
},
)
- Attach this IO manager to your job to make it available to your ops.
.. code-block:: python
from dagster import job
from cfa_dagster import ADLS2PickleIOManager
@job(
resource_defs={
"io_manager": ADLS2PickleIOManager(),
},
)
def my_job():
...
adls2: ResourceDependency[ADLS2Resource]
instance-attribute
¶
overrides: dict[str, Any] = Field(description="Override an upstream dependency input with a configured value e.g.`upstream_asset: 'static_value_for_testing'`", default_factory=dict)
class-attribute
instance-attribute
¶
use_production: bool = Field(description='Whether to use the production storage account for IO', default=(is_production()))
class-attribute
instance-attribute
¶
handle_output(context: OutputContext, obj: Any) -> None
¶
load_input(context: InputContext) -> Any
¶
AzureContainerAppJobRunLauncher
¶
Bases: RunLauncher, ConfigurableClass
Launches runs in an Azure Container App Job.
container_app_job_name = container_app_job_name
instance-attribute
¶
container_kwargs = check.opt_dict_param(container_kwargs, 'container_kwargs', key_type=str)
instance-attribute
¶
cpu = cpu
instance-attribute
¶
env_vars = env_vars
instance-attribute
¶
image = image
instance-attribute
¶
inst_data
property
¶
memory = memory
instance-attribute
¶
networks = [network]
instance-attribute
¶
registry = registry
instance-attribute
¶
supports_check_run_worker_health
property
¶
supports_resume_run
property
¶
__init__(inst_data: Optional[ConfigurableClassData] = None, container_app_job_name='cfa-dagster', cpu: float = None, memory: float = None, image: str = None, registry: str = None, env_vars: list[str] = None, network: str = None, networks: list[str] = None, container_kwargs=None, **kwargs)
¶
check_run_worker_health(run: DagsterRun)
¶
config_type()
classmethod
¶
from_config_value(inst_data: ConfigurableClassData, config_value: Mapping[str, Any]) -> Self
classmethod
¶
get_container_context(dagster_run: DagsterRun) -> DockerContainerContext
¶
launch_run(context: LaunchRunContext) -> None
¶
resume_run(context: ResumeRunContext) -> None
¶
terminate(run_id)
¶
AzureKeyVaultResource
¶
DynamicRunLauncher
¶
Bases: RunLauncher, ConfigurableClass
Launches a run using a runtime-configurable launcher
inst_data
property
¶
supports_check_run_worker_health
property
¶
supports_resume_run
property
¶
__init__(inst_data: Optional[ConfigurableClassData] = None)
¶
check_run_worker_health(run: DagsterRun) -> CheckRunHealthResult
¶
config_type()
classmethod
¶
from_config_value(inst_data: ConfigurableClassData, config_value: Mapping[str, Any]) -> Self
classmethod
¶
launch_run(context: LaunchRunContext) -> None
¶
resume_run(context: ResumeRunContext) -> None
¶
terminate(run_id)
¶
ExecutionConfig
dataclass
¶
TAG_KEY = 'cfa_dagster/execution'
class-attribute
instance-attribute
¶
executor: Optional[SelectorConfig] = None
class-attribute
instance-attribute
¶
launcher: Optional[SelectorConfig] = None
class-attribute
instance-attribute
¶
__init__(launcher: Optional[SelectorConfig] = None, executor: Optional[SelectorConfig] = None) -> None
¶
default() -> ExecutionConfig
classmethod
¶
from_executor_config(config: Mapping[str, Any], should_skip_executor: bool = False) -> ExecutionConfig
classmethod
¶
from_metadata(metadata: Optional[dict[str, MetadataValue]], should_skip_executor: bool = False) -> ExecutionConfig
classmethod
¶
from_run_config(config: Mapping[str, Any], should_skip_executor: bool = False) -> ExecutionConfig
classmethod
¶
from_run_tags(tags: Mapping[str, str], should_skip_executor: bool = False) -> ExecutionConfig
classmethod
¶
to_dict() -> Dict[str, str]
¶
to_metadata() -> Dict[str, str]
¶
to_run_config() -> Dict[str, str]
¶
to_run_tags() -> Dict[str, str]
¶
validate(use_full_schema: Optional[bool] = False) -> ExecutionConfig
¶
Validates the execution config against an environment-aware schema with an option to use the full schema
If only the launcher is specified, defaults will be applied to the supplied launcher class only.
If only the executor is specified, defaults will be applied to the supplied executor class only.
GraphDimension
¶
GraphDimensionExclusion
¶
SelectorConfig
dataclass
¶
class_name: str
instance-attribute
¶
config: Dict[str, Any] = field(default_factory=dict)
class-attribute
instance-attribute
¶
__init__(class_name: str, config: Dict[str, Any] = dict()) -> None
¶
from_json(value: Optional[Mapping[str, Any]]) -> Optional[SelectorConfig]
classmethod
¶
from_run_config(value: Optional[Mapping[str, Any]]) -> Optional[SelectorConfig]
classmethod
¶
to_run_config() -> Dict[str, Dict[str, Any]]
¶
azure_batch_executor(init_context: InitExecutorContext) -> Executor
¶
Executor which launches steps as Azure Batch tasks.
To use the azure_batch_executor, set it as the executor_def when defining a job:
.. code-block:: python some_job = dg.define_asset_job( name="some_job", executor_def=azure_container_app_job_executor, .. )
Then you can configure the executor with run config as follows:
.. code-block:: YAML
execution:
config:
pool_name: ...
image: ...
env_vars: ...
container_kwargs: ...
azure_container_app_job_executor(init_context: InitExecutorContext) -> Executor
¶
Executor which launches steps as Container App Job executions.
To use the azure_container_app_job_executor, set it as the executor_def when defining a job:
.. code-block:: python some_job = dg.define_asset_job( name="some_job", executor_def=azure_container_app_job_executor, .. )
Then you can configure the executor with run config as follows:
.. code-block:: YAML
execution:
config:
container_app_job_name: ...
cpu: ...
ram: ...
image: ...
env_vars: ...
If you're using the DockerRunLauncher, configuration set on the containers created by the run launcher will also be set on the containers that are created for each step.
collect_definitions(namespace)
¶
Function to collect Dagster definitions from a namespace. Usage:
collect definitions from globals() namespace in current file¶
collected_defs = collect_definitions(globals())
Create Definitions object passing collected definitions¶
defs = dg.Definitions( assets=collected_defs["assets"], asset_checks=collected_defs["asset_checks"], jobs=collected_defs["jobs"], sensors=collected_defs["sensors"], schedules=collected_defs["schedules"], )
docker_executor(init_context: InitExecutorContext) -> Executor
¶
Executor which launches steps as Docker containers.
To use the docker_executor, set it as the executor_def when defining a job:
.. literalinclude:: ../../../../../../python_modules/libraries/dagster-docker/dagster_docker_tests/test_example_executor.py :start-after: start_marker :end-before: end_marker :language: python
Then you can configure the executor with run config as follows:
.. code-block:: YAML
execution:
config:
registry: ...
network: ...
networks: ...
container_kwargs: ...
If you're using the DockerRunLauncher, configuration set on the containers created by the run launcher will also be set on the containers that are created for each step.
dynamic_executor(default_config: Optional[ExecutionConfig] = None, alternate_configs: Optional[list[ExecutionConfig]] = None)
¶
get_latest_metadata_for_partition(instance: dg.DagsterInstance, asset_key_str: str, partition_key: str) -> dict
¶
Returns the metadata from the latest materialization for a given asset and partition.
Used to pass data between assets via metadata when typical outputs are not available like when using BackfillPolicy.single_run().
get_run_timestamp(run: dg.DagsterRun) -> datetime
¶
Return the run start timestamp parsed from the cfa_dagster/run_ts tag.
Parameters¶
run : dg.DagsterRun The Dagster run object containing run metadata and tags.
Returns¶
datetime
A timezone-aware datetime object parsed from the ISO 8601 timestamp
stored in the cfa_dagster/run_ts tag.
Raises¶
KeyError
If the cfa_dagster/run_ts tag is not present on the run.
ValueError
If the tag value is not a valid ISO 8601 datetime string.
get_runs_url_for_tag(tag_key: str, tag_value: str) -> str
¶
get_webserver_url() -> str
¶
is_production() -> bool
¶
launch_asset_backfill(asset_keys: list[str], partition_keys: list[str], tags: dict = {}, run_config: dg.RunConfig = dg.RunConfig())
¶
require_dagster_user() -> str
¶
start_dev_env(caller_name: str)
¶
Start a local dg dev server when a definitions file is run directly.
Pass in the module's name, e.g. start_dev_env(__name__).
azure_adls2
¶
filesystem_io_manager
¶
ADLS2FilesystemIOManager
¶
Bases: ConfigurableIOManager
An IOManager that stores directories and files on ADLS2.
Assets should return a local pathlib.Path pointing to either a file or a directory.
The IOManager will upload the file or directory to ADLS2 and make it available to
downstream assets.
Downstream assets receive a local pathlib.Path pointing to the downloaded file or
directory. If the downstream asset's type annotation is str, the ADLS2 path is
returned directly without downloading (e.g. abfss://container@account.dfs.core.windows.net/...).
Partitioned assets are fully supported. When loading multiple partitions, the downstream
asset receives a Dict[str, Path] mapping partition keys to local paths, consistent
with Dagster's built-in IOManager behavior.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
use_production
|
bool
|
whether to access production storage or user-specific development storage |
required |
max_concurrency
|
int
|
Number of parallel chunks per file transfer. Higher values
improve throughput for large files at the cost of memory. Defaults to |
required |
Example:
.. code-block:: python
from dagster import Definitions, asset
from pathlib import Path
@asset(io_manager_key="adls2_dir")
def my_asset() -> Path:
out = Path("/tmp/my_output")
out.mkdir(exist_ok=True)
(out / "results.csv").write_text("a,b,c")
return out
@asset(io_manager_key="adls2_dir")
def downstream_asset(my_asset: Path) -> None:
df = pd.read_csv(my_asset / "results.csv")
@asset(io_manager_key="adls2_dir")
def path_only_asset(my_asset: str) -> None:
# receives the raw ADLS2 path without downloading
print(my_asset) # abfss://container@account.dfs.core.windows.net/dagster/my_asset
defs = Definitions(
assets=[my_asset, downstream_asset, path_only_asset],
resources={
"adls2_dir": ADLS2FilesystemIOManager()
},
)
adls2: ResourceDependency[ADLS2Resource]
instance-attribute
¶
delete_after_upload: bool = Field(default=False, description='Whether files/directories should be deleted after upload.Default: False')
class-attribute
instance-attribute
¶
dry_run: bool = Field(default=False, description='If True, log actions but do not upload or download any files.')
class-attribute
instance-attribute
¶
input_mode: InputMode = Field(default='download', description="Mode to determine behavior on loading inputs from upstream. 'download': Download the file(s) from upstream, 'path': return an abfss:// formatted path, 'reference': return an ADLS2Path which includes an authenticated ADLS2 client.")
class-attribute
instance-attribute
¶
max_concurrency: int = Field(default=4, description='Number of parallel chunks per file transfer. Higher valuesimprove throughput for large files at the cost of memory. Defaults to `4`,which gives a good balance for files in the hundreds of MB to GB range.')
class-attribute
instance-attribute
¶
on_input_conflict: OnInputConflict = Field(default='overwrite', description="Behavior when the local download target already exists. 'overwrite': Overwrite existing files (default), 'fail': Raise an error if the local directory exists and is non-empty, 'warn': Log a warning and proceed with the download, 'skip': Log a warning and return the existing directory without downloading, 'merge': Download only files that don't already exist locally.")
class-attribute
instance-attribute
¶
overrides: dict[str, Any] = Field(description="Override an upstream dependency input with a configured value e.g.`upstream_asset: 'static_value_for_testing'`", default_factory=dict)
class-attribute
instance-attribute
¶
use_production: bool = Field(description='Whether to use the production storage account for IO', default=(is_production()))
class-attribute
instance-attribute
¶
handle_output(context: OutputContext, obj: Any) -> None
¶
load_input(context: InputContext) -> Any
¶
FilesystemADLS2IOManager
¶
Bases: UPathIOManager
An IOManager that stores directories and files on ADLS2.
Assets should return a local pathlib.Path pointing to either a file or a directory.
The IOManager will upload the file or directory to ADLS2 and make it available to
downstream assets.
Downstream assets receive a local pathlib.Path pointing to the downloaded file or
directory. If the downstream asset's type annotation is str, the ADLS2 path is
returned directly without downloading (e.g. abfss://container@account.dfs.core.windows.net/...).
Partitioned assets are fully supported. When loading multiple partitions, the downstream
asset receives a Dict[str, Path] mapping partition keys to local paths, consistent
with Dagster's built-in IOManager behavior.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_system
|
str
|
The ADLS2 file system (container) name. |
required |
adls2_client
|
DataLakeServiceClient
|
An authenticated ADLS2 service client. |
required |
prefix
|
str
|
The path prefix within the file system. Defaults to |
'dagster'
|
max_concurrency
|
int
|
Number of parallel chunks per file transfer. Higher values
improve throughput for large files at the cost of memory. Defaults to |
4
|
Example:
.. code-block:: python
from azure.storage.filedatalake import DataLakeServiceClient
from dagster import Definitions, asset
from pathlib import Path
@asset(io_manager_key="adls2_dir")
def my_asset() -> Path:
out = Path("/tmp/my_output")
out.mkdir(exist_ok=True)
(out / "results.csv").write_text("a,b,c")
return out
@asset(io_manager_key="adls2_dir")
def downstream_asset(my_asset: Path) -> None:
df = pd.read_csv(my_asset / "results.csv")
@asset(io_manager_key="adls2_dir")
def path_only_asset(my_asset: str) -> None:
# receives the raw ADLS2 path without downloading
print(my_asset) # abfss://container@account.dfs.core.windows.net/dagster/my_asset
adls2_client = DataLakeServiceClient(
account_url="https://<account>.dfs.core.windows.net",
credential="<credential>",
)
defs = Definitions(
assets=[my_asset, downstream_asset, path_only_asset],
resources={
"adls2_dir": ADLS2FilesystemIOManager(
file_system="my-container",
adls2_client=adls2_client,
)
},
)
__init__(file_system: str, adls2_client: DataLakeServiceClient, input_mode: InputMode, on_input_conflict: OnInputConflict = 'overwrite', dry_run: bool = False, prefix: str = 'dagster', max_concurrency: int = 4, delete_after_upload: bool = False)
¶
download_prefix(adls2_prefix: str, local_dir: Path | None = None, on_conflict: OnInputConflict = 'overwrite') -> Path
¶
Download an ADLS prefix to a local directory.
Parameters¶
adls2_prefix: ADLS path relative to the filesystem root.
local_dir
Destination directory. If omitted, a temporary directory is created.
on_conflict
Behavior when local files already exist during download.
Returns¶
Path Local directory containing downloaded files.
dump_to_path(context: OutputContext, obj: Any, path: UPath) -> None
¶
Upload a local file or directory to ADLS2.
obj should be a pathlib.Path pointing to a local file or directory.
path is the ADLS2 destination path as constructed by UPathIOManager.
handle_output(context: OutputContext, obj: Any)
¶
load_from_path(context: InputContext, path: UPath) -> Union[ADLS2Path, Path, str]
¶
Download a directory from ADLS2 to the local filesystem.
If the downstream asset's type annotation is str, returns the ADLS2
path directly without downloading. Otherwise downloads all files under
the path and returns a local pathlib.Path to the directory.
load_input(context: InputContext) -> Union[Any, dict[str, Any]]
¶
make_directory(path: UPath) -> None
¶
path_exists(path: UPath) -> bool
¶
unlink(path: UPath) -> None
¶
filesystem_path
¶
ADLS2Path
dataclass
¶
Represents a path in ADLS2.
This object provides authenticated access to the underlying Azure SDK clients while also exposing convenience methods for common operations.
Users can always drop down to the Azure SDK if they need functionality beyond the convenience methods.
Examples¶
Download entire asset:
local_dir = data.download()
Download only a subfolder:
parquet_dir = data.download("parquet")
Access Azure SDK directly:
directory_client = data.get_directory_client()
for item in directory_client.get_paths():
...
file_system_client: FileSystemClient
property
¶
local_dir: Path
instance-attribute
¶
uri: str
property
¶
__init__(_io_manager: FilesystemADLS2IOManager, _path: str, local_dir: Path) -> None
¶
download(relative_path: str | None = None, local_dir: Path | None = None, on_conflict: OnInputConflict = 'overwrite') -> Path
¶
Download this path or a subpath.
Examples¶
Download entire asset:
data.download()
Download parquet subdirectory:
data.download("parquet")
Download nested path:
data.download("parquet/2026/01")
get_directory_client() -> DataLakeDirectoryClient
¶
get_file_client() -> DataLakeFileClient
¶
list(recursive: bool = False)
¶
List paths beneath this ADLS location.
Returns Azure SDK PathProperties objects.
filesystem_types
¶
pickle_io_manager
¶
ADLS2PickleIOManager
¶
Bases: ConfigurableIOManager
Persistent IO manager using Azure Data Lake Storage Gen2 for storage.
Serializes objects via pickling. Suitable for objects storage for distributed executors, so long as each execution node has network connectivity and credentials for ADLS and the backing container.
Assigns each op output to a unique filepath containing run ID, step key, and output name.
Assigns each asset to a single filesystem path, at "
Subsequent materializations of an asset will overwrite previous materializations of that asset.
With a base directory of "/my/base/path", an asset with key
AssetKey(["one", "two", "three"]) would be stored in a file called "three" in a directory
with path "/my/base/path/one/two/".
Example usage:
- Attach this IO manager to a set of assets.
.. code-block:: python
from dagster import Definitions, asset
from cfa_dagster import ADLS2PickleIOManager
@asset
def asset1():
# create df ...
return df
@asset
def asset2(asset1):
return df[:5]
Definitions(
assets=[asset1, asset2],
resources={
"io_manager": ADLS2PickleIOManager(),
},
)
- Attach this IO manager to your job to make it available to your ops.
.. code-block:: python
from dagster import job
from cfa_dagster import ADLS2PickleIOManager
@job(
resource_defs={
"io_manager": ADLS2PickleIOManager(),
},
)
def my_job():
...
adls2: ResourceDependency[ADLS2Resource]
instance-attribute
¶
overrides: dict[str, Any] = Field(description="Override an upstream dependency input with a configured value e.g.`upstream_asset: 'static_value_for_testing'`", default_factory=dict)
class-attribute
instance-attribute
¶
use_production: bool = Field(description='Whether to use the production storage account for IO', default=(is_production()))
class-attribute
instance-attribute
¶
handle_output(context: OutputContext, obj: Any) -> None
¶
load_input(context: InputContext) -> Any
¶
azure_batch
¶
azure_batch_executor(init_context: InitExecutorContext) -> Executor
¶
Executor which launches steps as Azure Batch tasks.
To use the azure_batch_executor, set it as the executor_def when defining a job:
.. code-block:: python some_job = dg.define_asset_job( name="some_job", executor_def=azure_container_app_job_executor, .. )
Then you can configure the executor with run config as follows:
.. code-block:: YAML
execution:
config:
pool_name: ...
image: ...
env_vars: ...
container_kwargs: ...
executor
¶
AzureBatchStepHandler
¶
Bases: StepHandler
name: str
property
¶
__init__(image: Optional[str], container_context: DockerContainerContext, pool_name: Optional[str])
¶
check_step_health(step_handler_context: StepHandlerContext) -> CheckStepHealthResult
¶
launch_step(step_handler_context: StepHandlerContext) -> Iterator[DagsterEvent]
¶
terminate_step(step_handler_context: StepHandlerContext) -> Iterator[DagsterEvent]
¶
azure_batch_executor(init_context: InitExecutorContext) -> Executor
¶
Executor which launches steps as Azure Batch tasks.
To use the azure_batch_executor, set it as the executor_def when defining a job:
.. code-block:: python some_job = dg.define_asset_job( name="some_job", executor_def=azure_container_app_job_executor, .. )
Then you can configure the executor with run config as follows:
.. code-block:: YAML
execution:
config:
pool_name: ...
image: ...
env_vars: ...
container_kwargs: ...
azure_container_app_job
¶
executor
¶
AzureContainerAppJobStepHandler
¶
Bases: StepHandler
name: str
property
¶
__init__(image: Optional[str], container_context: DockerContainerContext, container_app_job_name: str, cpu: float, memory: float)
¶
check_step_health(step_handler_context: StepHandlerContext) -> CheckStepHealthResult
¶
launch_step(step_handler_context: StepHandlerContext) -> Iterator[DagsterEvent]
¶
terminate_step(step_handler_context: StepHandlerContext) -> Iterator[DagsterEvent]
¶
azure_container_app_job_executor(init_context: InitExecutorContext) -> Executor
¶
Executor which launches steps as Container App Job executions.
To use the azure_container_app_job_executor, set it as the executor_def when defining a job:
.. code-block:: python some_job = dg.define_asset_job( name="some_job", executor_def=azure_container_app_job_executor, .. )
Then you can configure the executor with run config as follows:
.. code-block:: YAML
execution:
config:
container_app_job_name: ...
cpu: ...
ram: ...
image: ...
env_vars: ...
If you're using the DockerRunLauncher, configuration set on the containers created by the run launcher will also be set on the containers that are created for each step.
launcher
¶
CAJ_EXECUTION_ID_KEY = 'cfa_dagster/caj_execution_id'
module-attribute
¶
DOCKER_CONTAINER_ID_TAG = 'docker/container_id'
module-attribute
¶
AzureContainerAppJobRunLauncher
¶
Bases: RunLauncher, ConfigurableClass
Launches runs in an Azure Container App Job.
container_app_job_name = container_app_job_name
instance-attribute
¶
container_kwargs = check.opt_dict_param(container_kwargs, 'container_kwargs', key_type=str)
instance-attribute
¶
cpu = cpu
instance-attribute
¶
env_vars = env_vars
instance-attribute
¶
image = image
instance-attribute
¶
inst_data
property
¶
memory = memory
instance-attribute
¶
networks = [network]
instance-attribute
¶
registry = registry
instance-attribute
¶
supports_check_run_worker_health
property
¶
supports_resume_run
property
¶
__init__(inst_data: Optional[ConfigurableClassData] = None, container_app_job_name='cfa-dagster', cpu: float = None, memory: float = None, image: str = None, registry: str = None, env_vars: list[str] = None, network: str = None, networks: list[str] = None, container_kwargs=None, **kwargs)
¶
check_run_worker_health(run: DagsterRun)
¶
config_type()
classmethod
¶
from_config_value(inst_data: ConfigurableClassData, config_value: Mapping[str, Any]) -> Self
classmethod
¶
get_container_context(dagster_run: DagsterRun) -> DockerContainerContext
¶
launch_run(context: LaunchRunContext) -> None
¶
resume_run(context: ResumeRunContext) -> None
¶
terminate(run_id)
¶
utils
¶
CAJ_CONFIG_SCHEMA = merge_dicts(base_docker_executor.config_schema.config_type.fields, {'container_app_job_name': Field(StringSource, is_required=False, description='The name of the Container App Job. Default: cfa-dagster', default_value='cfa-dagster'), 'cpu': Field(Float, is_required=False, description='Required CPU in cores. Min: 0.25 Max: 4.0. CPU value must be half memory e.g. 0.25 cpu 0.5 memory'), 'memory': Field(Float, is_required=False, description='Required memory in GB from Min: 0.5 Max: 8.0Memory value must be double CPU e.g. 0.25 cpu 0.5 memory')})
module-attribute
¶
get_status_caj(client: ContainerAppsAPIClient, resource_group: str, container_app_job_name: str, job_execution_id: str)
¶
start_caj(client: ContainerAppsAPIClient, resource_group: str, container_app_job_name: str, image: str, env_vars: list[str], command: str, cpu: float, memory: float) -> str
¶
stop_caj(client: ContainerAppsAPIClient, resource_group: str, container_app_job_name: str, job_execution_id: str) -> bool
¶
azure_keyvault
¶
cli
¶
ALLOW_DEFAULT_DEFS_OVERRIDE_ENV = 'CFA_DAGSTER_ALLOW_DEFAULT_DEFS_OVERRIDE'
module-attribute
¶
DEFAULT_DEFS_FILE = 'dagster_defs.py'
module-attribute
¶
DEFAULT_WORKSPACE_FILES = ('workspace.yaml', 'workspace.yml')
module-attribute
¶
LOCAL_HOSTNAME = '127.0.0.1'
module-attribute
¶
LOCAL_PORT = 4000
module-attribute
¶
TargetKind = Literal['python_file', 'module', 'workspace']
module-attribute
¶
configure_dev_db()
¶
find_pyproject_toml(start_dir: Path) -> Optional[Path]
¶
get_defs_target(start_dir: Optional[Path] = None) -> Optional[str]
¶
Resolve a [tool.dg] definitions module to a relative Python file.
get_dg_project_config(start_dir: Optional[Path] = None) -> tuple[Path, dict] | None
¶
resolve_defs_file(start_dir: Path | None = None) -> str
¶
Resolve the configured definitions file or return the default file.
resolve_project_module_path(pyproject_path: Path, module_name: str) -> Path | None
¶
run_dagster()
¶
Wrapper for the dagster cli.
run_dagster_webserver()
¶
Wrapper for the dagster-webserver cli.
run_dg(argv: Optional[list[str]] | None = None)
¶
Wrapper for the dg cli.
set_env_vars()
¶
start_dev_env(caller_name: str)
¶
Start a local dg dev server when a definitions file is run directly.
Pass in the module's name, e.g. start_dev_env(__name__).
docker
¶
executor
¶
docker_executor(init_context: InitExecutorContext) -> Executor
¶
Executor which launches steps as Docker containers.
To use the docker_executor, set it as the executor_def when defining a job:
.. literalinclude:: ../../../../../../python_modules/libraries/dagster-docker/dagster_docker_tests/test_example_executor.py :start-after: start_marker :end-before: end_marker :language: python
Then you can configure the executor with run config as follows:
.. code-block:: YAML
execution:
config:
registry: ...
network: ...
networks: ...
container_kwargs: ...
If you're using the DockerRunLauncher, configuration set on the containers created by the run launcher will also be set on the containers that are created for each step.
dynamic_graph_asset
¶
GraphAssetKwargs
¶
Bases: TypedDict
automation_condition: Optional[dg.AutomationCondition] = (None,)
class-attribute
instance-attribute
¶
backfill_policy: Optional[dg.BackfillPolicy] = (None,)
class-attribute
instance-attribute
¶
check_specs: Optional[TypeSequence[dg.AssetCheckSpec]] = (None,)
class-attribute
instance-attribute
¶
code_version: Optional[str] = (None,)
class-attribute
instance-attribute
¶
config: Optional[Union[dg.ConfigMapping, Mapping[str, Any]]] = (None,)
class-attribute
instance-attribute
¶
description: Optional[str] = (None,)
class-attribute
instance-attribute
¶
group_name: Optional[str] = (None,)
class-attribute
instance-attribute
¶
hooks: Optional[AbstractSet[dg.HookDefinition]] = (None,)
class-attribute
instance-attribute
¶
key: Optional[CoercibleToAssetKey] = (None,)
class-attribute
instance-attribute
¶
key_prefix: Optional[CoercibleToAssetKeyPrefix] = (None,)
class-attribute
instance-attribute
¶
kinds: Optional[AbstractSet[str]] = (None,)
class-attribute
instance-attribute
¶
metadata: Optional[RawMetadataMapping] = (None,)
class-attribute
instance-attribute
¶
name: Optional[str] = (None,)
class-attribute
instance-attribute
¶
owners: Optional[TypeSequence[str]] = (None,)
class-attribute
instance-attribute
¶
partitions_def: Optional[dg.PartitionsDefinition] = (None,)
class-attribute
instance-attribute
¶
resource_defs: Optional[Mapping[str, dg.ResourceDefinition]] = (None,)
class-attribute
instance-attribute
¶
tags: Optional[Mapping[str, str]] = (None,)
class-attribute
instance-attribute
¶
GraphDimension
¶
GraphDimensionExclusion
¶
dynamic_graph_asset(fn: Callable[..., Any] | None = None, *, ins: dict[str, dg.In] | None = None, io_manager_key: str | None = None, retry_policy: dg.RetryPolicy | None = None, output_mode: Literal['first', 'all'] = 'all', **graph_asset_kwargs: Unpack[GraphAssetKwargs]) -> dg.AssetsDefinition | Callable[[Callable[..., Any]], dg.AssetsDefinition]
¶
Decorator that wires a function into a dynamic graph asset to run steps in parallel based on a provided ConfigurableResource. See https://docs.dagster.io/guides/build/ops/dynamic-graphs#using-dynamic-outputs and https://docs.dagster.io/guides/build/assets/graph-backed-assets
The decorated function becomes the compute op, called once per combination
of graph_dimensions field values. ConfigurableResource fields types as GraphDimensions are unpacked to
single scalar values inside the function body.
graph_dimensions values are encoded into the internal op mapping key using XX hex escaping so original values (including spaces, hyphens, etc.) are recovered exactly in the compute op, while safe characters remain human-readable in the Dagster UI.
Use output_mode to control whether the output is emitted from a single dimension or collected from all dimensions.
This is especially powerful with the ADLS2FilesystemIOManager since you can upload a file or directory for each graph dimension and return the parent directory as the final output.
Downstream assets using the ADLS2FilesystemIOManager will download the structured directory automatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Optional[str]
|
The name of the asset. If not provided, defaults to the name of the decorated function. The asset's name must be a valid name in Dagster (ie only contains letters, numbers, and underscores) and may not contain Python reserved keywords. |
required |
description
|
Optional[str]
|
A human-readable description of the asset. about the input. |
required |
ins
|
Optional[Dict[str, In]]
|
Information about the inputs to the op. Information provided here will be combined
with what can be inferred from the function signature.
Inputs can set |
None
|
config
|
Optional[Union[ConfigMapping], Mapping[str, Any]
|
Describes how the graph underlying the asset is configured at runtime. If a :py:class: If a dictionary is provided, then it will be used as the default run config for the graph. This means it must conform to the config schema of the underlying nodes. Note that the values provided will be viewable and editable in the Dagster UI, so be careful with secrets. If no value is provided, then the config schema for the graph is the default (derived from the underlying nodes). |
required |
key_prefix
|
Optional[Union[str, Sequence[str]]]
|
If provided, the asset's key is the concatenation of the key_prefix and the asset's name, which defaults to the name of the decorated function. Each item in key_prefix must be a valid name in Dagster (ie only contains letters, numbers, and underscores) and may not contain Python reserved keywords. |
required |
group_name
|
Optional[str]
|
A string name used to organize multiple assets into groups. If not provided, the name "default" is used. |
required |
partitions_def
|
Optional[PartitionsDefinition]
|
Defines the set of partition keys that compose the asset. |
required |
hooks
|
Optional[AbstractSet[HookDefinition]]
|
A set of hooks to attach to the asset. These hooks will be executed when the asset is materialized. |
required |
metadata
|
Optional[RawMetadataMapping]
|
Dictionary of metadata to be associated with the asset. |
required |
io_manager_key
|
Optional[str]
|
The resource key of the IOManager used for storing the output of the op as an asset, and for loading it in downstream ops (default: "io_manager"). |
None
|
tags
|
Optional[Mapping[str, str]]
|
Tags for filtering and organizing. These tags are not attached to runs of the asset. |
required |
owners
|
Optional[Sequence[str]]
|
A list of strings representing owners of the asset. Each
string can be a user's email address, or a team name prefixed with |
required |
kinds
|
Optional[Set[str]]
|
A list of strings representing the kinds of the asset. These will be made visible in the Dagster UI. |
required |
automation_condition
|
Optional[AutomationCondition]
|
The AutomationCondition to use for this asset. |
required |
backfill_policy
|
Optional[BackfillPolicy]
|
The BackfillPolicy to use for this asset. |
required |
code_version
|
Optional[str]
|
Version of the code that generates this asset. In general, versions should be set only for code that deterministically produces the same output when given the same inputs. |
required |
retry_policy
|
Optional[RetryPolicy]
|
The retry policy for this asset. |
None
|
output_mode
|
Literal['first', 'all']
|
Controls whether the output is emitted from a
single dimension ( |
'all'
|
key
|
Optional[CoeercibleToAssetKey]
|
The key for this asset. If provided, cannot specify key_prefix or name. |
required |
Example
Define ConfigurableResource with GraphDimensions:
class MyConfig(dg.ConfigurableResource): disease: Dimension[str] = Dimension(["covid", "flu", "rsv"]) state: Dimension[str] = Dimension(["CA", "TX", "NY"]) container: str
defs = dg.Definitions( ... resources = { "my_config": MyConfig() } )
Single value for all graph dimensions:
@dynamic_graph_asset( partitions_def=daily_partitions, ins={"upstream": dg.AssetIn("some_upstream_asset")}, output_mode="first", ) def my_dynamic_asset(context: dg.OpExecutionContext, my_config: MyConfig, upstream_asset): my_code_pipeline(my_config.disease.current_value, my_config.state.current_value, upstream_asset) return dg.Output( value=f"staging/{context.partition_key}", metadata={"container": config.base_output_prefix}, ) Returns: staging/2026-03-10
Aggregated value from each graph dimension:
@dynamic_graph_asset( partitions_def=daily_partitions, io_manager_key="ADLS2PickleIOManager", ins={"upstream": dg.AssetIn("some_upstream_asset")}, output_mode="all", ) def my_dynamic_asset(context: dg.OpExecutionContext, my_config: MyConfig, upstream_asset): result = my_code_pipeline(my_config.disease.current_value, my_config.state.current_value, upstream_asset) return dg.Output( value=result, metadata={"container": config.base_output_prefix}, ) Returns: [result_1, result_2, ... result_n]
Dynamic graph input inheritance:
@dynamic_graph_asset( partitions_def=daily_partitions, io_manager_key="ADLS2PickleIOManager", output_mode="all", ) def upstream_by_dimension(context: dg.OpExecutionContext, my_config: MyConfig): return {"disease": my_config.disease.current_value}
@dynamic_graph_asset( partitions_def=daily_partitions, ins={ "upstream_by_dimension": dg.In( input_manager_key="ADLS2PickleIOManager", metadata={ # Optional: this is the default for upstream dynamic_graph_asset(output_mode="all"). "should_input_manager_inherit_graph_dimensions": True, }, ), }, ) def downstream_by_dimension( context: dg.OpExecutionContext, my_config: MyConfig, upstream_by_dimension: dict, ): assert upstream_by_dimension["disease"] == my_config.disease.current_value
To force a downstream input to load the upstream asset without graph-dimension
inheritance, set metadata={"should_input_manager_inherit_graph_dimensions": False}.
File from each graph dimension:
@dynamic_graph_asset( partitions_def=daily_partitions, io_manager_key="ADLS2FilesystemIOManager", ins={"upstream": dg.AssetIn("some_upstream_asset")}, output_mode="all", ) def my_dynamic_asset(context: dg.OpExecutionContext, my_config: MyConfig, upstream_asset): output_path = my_code_pipeline(my_config.disease.current_value, my_config.state.current_value, upstream_asset) return dg.Output( value=output_path, metadata={"container": config.base_output_prefix}, ) Returns: abfss://cfadagster/dagster-files/username/my_dynamic_asset/2026-04-13 Downstream dependencies will download the files directly with the following structure: my_dynamic_asset/ └── 2026-04-13 ├── COVID │ ├── AZ │ │ └── COVID_AZ.txt │ └── NY │ └── COVID_NY.txt └── FLU ├── AZ │ └── FLU_AZ.txt └── NY └── FLU_NY.txt
dynamic_graph_asset_metadata
¶
DYNAMIC_GRAPH_ASSET_METADATA_KEY = 'cfa_dagster/dynamic_graph_asset_metadata'
module-attribute
¶
DYNAMIC_GRAPH_IO_MANAGER_METADATA_KEY = 'cfa_dagster/dynamic_graph_asset_io_metadata'
module-attribute
¶
SHOULD_INPUT_MANAGER_INHERIT_GRAPH_DIMENSIONS = 'should_input_manager_inherit_graph_dimensions'
module-attribute
¶
DynamicGraphIOManagerMetadata
dataclass
¶
asset_key_path: list[str] = field(default_factory=list)
class-attribute
instance-attribute
¶
asset_partition_keys: list[Any] = field(default_factory=list)
class-attribute
instance-attribute
¶
skip_input: bool = False
class-attribute
instance-attribute
¶
skip_output: bool = False
class-attribute
instance-attribute
¶
synthetic_partition_keys: list[str] = field(default_factory=list)
class-attribute
instance-attribute
¶
__init__(asset_key_path: list[str] = list(), asset_partition_keys: list[Any] = list(), synthetic_partition_keys: list[str] = list(), skip_input: bool = False, skip_output: bool = False) -> None
¶
from_metadata(metadata: dict) -> Optional[DynamicGraphIOManagerMetadata]
classmethod
¶
to_dict() -> dict
¶
expand_and_combine_partition_keys(real_keys: list[Any], synthetic_partition_keys: list[str]) -> list[str]
¶
get_inherited_graph_dimension_input_metadata(context: dg.InputContext) -> Optional[DynamicGraphIOManagerMetadata]
¶
Build dynamic graph IO metadata for a @dynamic_graph_asset input that should inherit upstream graph dimensions.
dg.In.metadata is static, so it cannot contain the current mapped graph
dimension values. When inheritance is enabled, derive those values from the
mapped input context at load time instead.
Inheritance is enabled when the user explicitly sets
should_input_manager_inherit_graph_dimensions=True, or by default when
the upstream asset is a dynamic graph asset with output_mode="all".
Explicit False disables inheritance.
This metadata is more specific than static DynamicGraphIOManagerMetadata
on the input because it comes from the current mapped step and upstream
asset context, so IO managers should let it take precedence when both are
present.
patch_context_with_dynamic_graph_metadata(context: dg.InputContext | dg.OutputContext, metadata: DynamicGraphIOManagerMetadata) -> None
¶
execution
¶
executor
¶
run_coordinator
¶
run_launcher
¶
EXECUTION_CONFIG_KEY = 'cfa_dagster/execution'
module-attribute
¶
LAUNCHER_CONFIG_KEY = 'cfa_dagster/launcher'
module-attribute
¶
DynamicRunLauncher
¶
Bases: RunLauncher, ConfigurableClass
Launches a run using a runtime-configurable launcher
inst_data
property
¶
supports_check_run_worker_health
property
¶
supports_resume_run
property
¶
__init__(inst_data: Optional[ConfigurableClassData] = None)
¶
check_run_worker_health(run: DagsterRun) -> CheckRunHealthResult
¶
config_type()
classmethod
¶
from_config_value(inst_data: ConfigurableClassData, config_value: Mapping[str, Any]) -> Self
classmethod
¶
launch_run(context: LaunchRunContext) -> None
¶
resume_run(context: ResumeRunContext) -> None
¶
terminate(run_id)
¶
step_handler
¶
RoutingStepHandler
¶
SubprocessStepHandler
¶
Bases: StepHandler
Executes each step in a subprocess. Supports the same config as multiprocess_executor. Note: tag_concurrency_limits is not supported — it is implemented at the StepDelegatingExecutor level and cannot be enforced per StepHandler.
SynchronousStepHandler
¶
Bases: StepHandler
Executes steps one at a time by blocking until each subprocess completes. Unlike SubprocessStepHandler, this runs steps synchronously so the next step cannot start until this one finishes — useful for lightweight ops that should not incur container spin-up cost but also should not run concurrently with their dependents.
create_executor_step_handler(init_context: InitExecutorContext, execution_config: ExecutionConfig) -> StepDelegatingExecutor
¶
utils
¶
ExecutionConfig
dataclass
¶
TAG_KEY = 'cfa_dagster/execution'
class-attribute
instance-attribute
¶
executor: Optional[SelectorConfig] = None
class-attribute
instance-attribute
¶
launcher: Optional[SelectorConfig] = None
class-attribute
instance-attribute
¶
__init__(launcher: Optional[SelectorConfig] = None, executor: Optional[SelectorConfig] = None) -> None
¶
default() -> ExecutionConfig
classmethod
¶
from_executor_config(config: Mapping[str, Any], should_skip_executor: bool = False) -> ExecutionConfig
classmethod
¶
from_metadata(metadata: Optional[dict[str, MetadataValue]], should_skip_executor: bool = False) -> ExecutionConfig
classmethod
¶
from_run_config(config: Mapping[str, Any], should_skip_executor: bool = False) -> ExecutionConfig
classmethod
¶
from_run_tags(tags: Mapping[str, str], should_skip_executor: bool = False) -> ExecutionConfig
classmethod
¶
to_dict() -> Dict[str, str]
¶
to_metadata() -> Dict[str, str]
¶
to_run_config() -> Dict[str, str]
¶
to_run_tags() -> Dict[str, str]
¶
validate(use_full_schema: Optional[bool] = False) -> ExecutionConfig
¶
Validates the execution config against an environment-aware schema with an option to use the full schema
If only the launcher is specified, defaults will be applied to the supplied launcher class only.
If only the executor is specified, defaults will be applied to the supplied executor class only.
SelectorConfig
dataclass
¶
class_name: str
instance-attribute
¶
config: Dict[str, Any] = field(default_factory=dict)
class-attribute
instance-attribute
¶
__init__(class_name: str, config: Dict[str, Any] = dict()) -> None
¶
from_json(value: Optional[Mapping[str, Any]]) -> Optional[SelectorConfig]
classmethod
¶
from_run_config(value: Optional[Mapping[str, Any]]) -> Optional[SelectorConfig]
classmethod
¶
to_run_config() -> Dict[str, Dict[str, Any]]
¶
get_dynamic_executor_config_schema(default_config: Optional[ExecutionConfig] = None, alternate_configs: Optional[list[ExecutionConfig]] = None, use_full_schema: Optional[bool] = False) -> dict
¶
Returns a config schema for the dynamic executor with parameters for defaults and an option to return the full schema without prod restrictions.
alternate_configs: A list of ExecutionConfig objects whose launcher/executor configs will be used as default values for those selectors in the Launchpad.
with_alternate_default(fields: dict, alternates: dict[str, dict]) -> dict
¶
Takes a Dagster config schema and returns a copy with alternate default values
hot_reload
¶
RELOAD_MUTATION = '\nmutation ReloadWorkspace {\n reloadWorkspace {\n __typename\n ... on Workspace { id }\n ... on PythonError { message stack }\n }\n}\n'
module-attribute
¶
reload_via_graphql(host: str, port: int) -> bool
¶
resolve_target_paths(entry_point: Optional[str | Path] = None, pyproject_path: Optional[str | Path] = None) -> list[Path]
¶
start_hot_reloader_for_dev(args: list[str], defs_file: str, host: str, port: int, pyproject_path: Optional[str | Path] = None) -> Optional[HotReloader]
¶
wait_for_server(host: str, port: int, max_retries: int = 15, delay: float = 2.0) -> bool
¶
utils
¶
LOCAL_HOSTNAME = '127.0.0.1'
module-attribute
¶
LOCAL_PORT = 4000
module-attribute
¶
PROD_HOSTNAME = os.getenv('DAGSTER_WEBSERVER_URL', 'dagster.apps.edav.ext.cdc.gov')
module-attribute
¶
collect_definitions(namespace)
¶
Function to collect Dagster definitions from a namespace. Usage:
collect definitions from globals() namespace in current file¶
collected_defs = collect_definitions(globals())
Create Definitions object passing collected definitions¶
defs = dg.Definitions( assets=collected_defs["assets"], asset_checks=collected_defs["asset_checks"], jobs=collected_defs["jobs"], sensors=collected_defs["sensors"], schedules=collected_defs["schedules"], )
get_graphql_client() -> DagsterGraphQLClient
¶
get_latest_metadata_for_partition(instance: dg.DagsterInstance, asset_key_str: str, partition_key: str) -> dict
¶
Returns the metadata from the latest materialization for a given asset and partition.
Used to pass data between assets via metadata when typical outputs are not available like when using BackfillPolicy.single_run().
get_run_timestamp(run: dg.DagsterRun) -> datetime
¶
Return the run start timestamp parsed from the cfa_dagster/run_ts tag.
Parameters¶
run : dg.DagsterRun The Dagster run object containing run metadata and tags.
Returns¶
datetime
A timezone-aware datetime object parsed from the ISO 8601 timestamp
stored in the cfa_dagster/run_ts tag.
Raises¶
KeyError
If the cfa_dagster/run_ts tag is not present on the run.
ValueError
If the tag value is not a valid ISO 8601 datetime string.