API Reference
This section provides an overview and links to the Kedro-Dagster API documentation.
Command Line Interface
Kedro-Dagster provides CLI commands to initialize and run the translation of your Kedro project into Dagster.
kedro dagster init
Initializes Dagster integration for your Kedro project by generating the necessary definitions.py
and configuration files.
Updates the template of a kedro project.
Running this command is mandatory to use Kedro-Dagster.
This adds
- "conf/base/dagster.yml": This is a configuration file used for the dagster run parametrization.
- "src/
/definitions.py": This is the dagster file where all dagster definitions are set.
Source code in src/kedro_dagster/cli.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
Usage:
uv run kedro dagster init --env <ENV_NAME> --force --silent
--env
: The Kedro environment where thedagster.yml
should be created (default:local
).--force
: Overwrite existing files without prompting.--silent
: Suppress output messages when files are modified.
kedro dagster dev
Starts the Dagster development UI and launches your Kedro pipelines as Dagster jobs for interactive development and monitoring.
Opens the dagster dev user interface with the
project-specific settings of dagster.yml
.
Source code in src/kedro_dagster/cli.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
|
Usage:
uv run kedro dagster dev --env <ENV_NAME> --log-level <LEVEL> --log-format <FORMAT> --port <PORT> --host <HOST> --live-data-poll-rate <RATE>
--env
: The Kedro environment to use (e.g.,local
).--log-level
: Logging level (debug
,info
,warning
,error
, orcritical
).--log-format
: Log output format (colored
,json
,default
).--port
: Port for the Dagster UI.--host
: Host address for the Dagster UI.--live-data-poll-rate
: Polling rate for live data in milliseconds.
If specified, those options will override the ones specified in your conf/<ENV_NAME>/dagster.yml
. See DevOptions
.
Configuration
The following classes define the configuration schema for Kedro-Dagster's dagster.yml
, using Pydantic models.
KedroDagsterConfig
Main configuration class for Kedro-Dagster, representing the structure of the dagster.yml
file.
Bases: BaseModel
Main configuration class for Kedro-Dagster, representing the structure of the dagster.yml
file.
Attributes:
-
dev
(DevOptions | None
) –Options for
kedro dagster dev
command. -
executors
(dict[str, ExecutorOptions] | None
) –Mapping of executor names to executor options.
-
schedules
(dict[str, ScheduleOptions] | None
) –Mapping of schedule names to schedule options.
-
jobs
(dict[str, JobOptions] | None
) –Mapping of job names to job options.
DevOptions
Options for the kedro dagster dev
command.
Bases: BaseModel
Development configuration options for the kedro dagster dev
command.
Attributes:
-
log_level
(Literal['critical', 'error', 'warning', 'info', 'debug']
) –Logging level.
-
log_format
(Literal['colored', 'json', 'rich']
) –Format for log output.
-
port
(str
) –Port for the dev server.
-
host
(str
) –Host for the dev server.
-
live_data_poll_rate
(str
) –Poll rate for live data updates in milliseconds.
JobOptions
Configuration options for a Dagster job, including pipeline filtering, executor, and schedule.
Bases: BaseModel
Configuration options for a Dagster job.
Attributes:
-
pipeline
(PipelineOptions
) –PipelineOptions specifying which pipeline and nodes to run.
-
executor
(ExecutorOptions | str | None
) –ExecutorOptions instance or string key referencing an executor.
-
schedule
(ScheduleOptions | str | None
) –ScheduleOptions instance or string key referencing a schedule.
PipelineOptions
Options for filtering and configuring Kedro pipelines within jobs.
Bases: BaseModel
Options for filtering and configuring Kedro pipelines within a Dagster job.
Attributes:
-
pipeline_name
(str | None
) –Name of the Kedro pipeline to run.
-
from_nodes
(list[str] | None
) –List of node names to start execution from.
-
to_nodes
(list[str] | None
) –List of node names to end execution at.
-
node_names
(list[str] | None
) –List of specific node names to include in the pipeline.
-
from_inputs
(list[str] | None
) –List of dataset names to use as entry points.
-
to_outputs
(list[str] | None
) –List of dataset names to use as exit points.
-
node_namespace
(str | None
) –Namespace to filter nodes by.
-
tags
(list[str] | None
) –List of tags to filter nodes by.
ExecutorOptions
Base class for executor configuration. See specific executor option classes below.
InProcessExecutorOptions
Options for the in-process executor.
Bases: BaseModel
Options for the in-process executor.
Attributes:
-
retries
(RetriesEnableOptions | RetriesDisableOptions
) –Retry configuration for the executor.
MultiprocessExecutorOptions
Options for the multiprocess executor.
Bases: InProcessExecutorOptions
Options for the multiprocess executor.
Attributes:
-
retries
(RetriesEnableOptions | RetriesDisableOptions
) –Retry configuration for the executor.
-
max_concurrent
(int | None
) –Maximum number of concurrent processes.
DaskExecutorOptions
Options for the Dask executor.
Bases: BaseModel
Options for the Dask executor.
Attributes:
-
cluster
(DaskClusterConfig
) –Configuration for the Dask cluster.
where DaskClusterConfig
is defined as:
Bases: BaseModel
Configuration for the Dask cluster.
Attributes:
-
existing
(dict[str, str] | None
) –Connect to an existing scheduler.
-
local
(dict[str, Any] | None
) –Local cluster configuration.
-
yarn
(dict[str, Any] | None
) –YARN cluster configuration.
-
ssh
(dict[str, Any] | None
) –SSH cluster configuration.
-
pbs
(dict[str, Any] | None
) –PBS cluster configuration.
-
moab
(dict[str, Any] | None
) –Moab cluster configuration.
-
sge
(dict[str, Any] | None
) –SGE cluster configuration.
-
lsf
(dict[str, Any] | None
) –LSF cluster configuration.
-
slurm
(dict[str, Any] | None
) –SLURM cluster configuration.
-
oar
(dict[str, Any] | None
) –OAR cluster configuration.
-
kube
(dict[str, Any] | None
) –Kubernetes cluster configuration.
DockerExecutorOptions
Options for the Docker-based executor.
Bases: MultiprocessExecutorOptions
Options for the Docker-based executor.
Attributes:
-
retries
(RetriesEnableOptions | RetriesDisableOptions
) –Retry configuration for the executor.
-
max_concurrent
(int | None
) –Maximum number of concurrent processes.
-
image
(str | None
) –Docker image to use.
-
network
(str | None
) –Name of the network to connect the container at creation time.
-
registry
(dict[str, str] | None
) –Information for using a non local/public docker registry.
-
env_vars
(list[str]
) –Environment variables for the container.
-
container_kwargs
(dict[str, Any] | None
) –Key-value pairs for containers.create.
-
networks
(list[str]
) –Names of the networks to connect the container at creation time.
CeleryExecutorOptions
Options for the Celery-based executor.
Bases: BaseModel
Options for the Celery-based executor.
Attributes:
-
broker
(str | None
) –Celery broker URL.
-
backend
(str | None
) –Celery backend URL.
-
include
(list[str]
) –List of modules every worker should import.
-
config_source
(dict[str, Any] | None
) –Additional settings for the Celery app.
-
retries
(int | None
) –Number of retries for the Celery tasks.
CeleryDockerExecutorOptions
Options for the Celery executor with Docker support.
Bases: CeleryExecutorOptions
, DockerExecutorOptions
Options for the Celery-based executor which launches tasks as Docker containers.
Attributes:
-
broker
(str | None
) –Celery broker URL.
-
backend
(str | None
) –Celery backend URL.
-
include
(list[str]
) –List of modules every worker should import.
-
config_source
(dict[str, Any] | None
) –Additional settings for the Celery app.
-
retries
(int | None
) –Number of retries for the Celery tasks.
-
image
(str | None
) –Docker image to use.
-
network
(str | None
) –Name of the network to connect the container at creation time.
-
registry
(dict[str, str] | None
) –Information for using a non local/public docker registry.
-
env_vars
(list[str]
) –Environment variables for the container.
-
container_kwargs
(dict[str, Any] | None
) –Key-value pairs for containers.create.
-
networks
(list[str]
) –Names of the networks to connect the container at creation time.
-
max_concurrent
(int | None
) –Maximum number of concurrent processes.
-
retries
(RetriesEnableOptions | RetriesDisableOptions
) –Retry configuration for the executor.
K8sJobExecutorOptions
Options for the Kubernetes-based executor.
Bases: MultiprocessExecutorOptions
Options for the Kubernetes-based executor.
Attributes:
-
retries
(RetriesEnableOptions | RetriesDisableOptions
) –Retry configuration for the executor.
-
max_concurrent
(int | None
) –Maximum number of concurrent processes.
-
job_namespace
(str | None
) –Kubernetes namespace for jobs.
-
load_incluster_config
(bool | None
) –Whether the executor is running within a k8s cluster.
-
kubeconfig_file
(str | None
) –Path to a kubeconfig file to use.
-
step_k8s_config
(K8sJobConfig
) –Raw Kubernetes configuration for each step.
-
per_step_k8s_config
(dict[str, K8sJobConfig]
) –Per op k8s configuration overrides.
-
image_pull_policy
(str | None
) –Image pull policy for Pods.
-
image_pull_secrets
(list[dict[str, str]] | None
) –Credentials for pulling images.
-
service_account_name
(str | None
) –Kubernetes service account name.
-
env_config_maps
(list[str] | None
) –ConfigMapEnvSource names for environment variables.
-
env_secrets
(list[str] | None
) –Secret names for environment variables.
-
env_vars
(list[str] | None
) –Environment variables for the job.
-
volume_mounts
(list[dict[str, str]]
) –Volume mounts for the container.
-
volumes
(list[dict[str, str]]
) –Volumes for the Pod.
-
labels
(dict[str, str]
) –Labels for created pods.
-
resources
(dict[str, dict[str, str]] | None
) –Compute resource requirements.
-
scheduler_name
(str | None
) –Custom Kubernetes scheduler for Pods.
-
security_context
(dict[str, str]
) –Security settings for the container.
where K8sJobConfig
is defined as:
Bases: BaseModel
Configuration for Kubernetes jobs.
Attributes:
-
container_config
(dict[str, Any] | None
) –Configuration for the Kubernetes container.
-
pod_spec_config
(dict[str, Any] | None
) –Configuration for the Pod specification.
-
pod_template_spec_metadata
(dict[str, Any] | None
) –Metadata for the Pod template specification.
-
job_spec_config
(dict[str, Any] | None
) –Configuration for the Job specification.
-
job_metadata
(dict[str, Any] | None
) –Metadata for the Job.
CeleryK8sJobExecutorOptions
Options for the Celery executor with Kubernetes support.
Bases: CeleryExecutorOptions
, K8sJobExecutorOptions
Options for the Celery-based executor which launches tasks as Kubernetes jobs.
Attributes:
-
broker
(str | None
) –Celery broker URL.
-
backend
(str | None
) –Celery backend URL.
-
include
(list[str]
) –List of modules every worker should import.
-
config_source
(dict[str, Any] | None
) –Additional settings for the Celery app.
-
retries
(int | None
) –Number of retries for the Celery tasks.
-
job_namespace
(str | None
) –Kubernetes namespace for jobs.
-
load_incluster_config
(bool | None
) –Whether the executor is running within a k8s cluster.
-
kubeconfig_file
(str | None
) –Path to a kubeconfig file to use.
-
step_k8s_config
(K8sJobConfig
) –Raw Kubernetes configuration for each step.
-
per_step_k8s_config
(dict[str, K8sJobConfig]
) –Per op k8s configuration overrides.
-
image_pull_policy
(str | None
) –Image pull policy for Pods.
-
image_pull_secrets
(list[dict[str, str]] | None
) –Credentials for pulling images.
-
service_account_name
(str | None
) –Kubernetes service account name.
-
env_config_maps
(list[str] | None
) –ConfigMapEnvSource names for environment variables.
-
env_secrets
(list[str] | None
) –Secret names for environment variables.
-
env_vars
(list[str] | None
) –Environment variables for the job.
-
volume_mounts
(list[dict[str, str]]
) –Volume mounts for the container.
-
volumes
(list[dict[str, str]]
) –Volumes for the Pod.
-
labels
(dict[str, str]
) –Labels for created pods.
-
resources
(dict[str, dict[str, str]] | None
) –Compute resource requirements.
-
scheduler_name
(str | None
) –Custom Kubernetes scheduler for Pods.
-
security_context
(dict[str, str]
) –Security settings for the container.
-
job_wait_timeout
(float
) –Wait time in seconds for a job to complete before marking as failed.
where K8sJobConfig
is defined as:
Bases: BaseModel
Configuration for Kubernetes jobs.
Attributes:
-
container_config
(dict[str, Any] | None
) –Configuration for the Kubernetes container.
-
pod_spec_config
(dict[str, Any] | None
) –Configuration for the Pod specification.
-
pod_template_spec_metadata
(dict[str, Any] | None
) –Metadata for the Pod template specification.
-
job_spec_config
(dict[str, Any] | None
) –Configuration for the Job specification.
-
job_metadata
(dict[str, Any] | None
) –Metadata for the Job.
ScheduleOptions
Options for defining Dagster schedules.
Bases: BaseModel
Options for defining Dagster schedules.
Attributes:
-
cron_schedule
(str
) –Cron expression for the schedule.
-
execution_timezone
(str | None
) –Timezone in which the schedule should execute.
-
description
(str | None
) –Optional description of the schedule.
-
metadata
(dict[str, Any] | None
) –Additional metadata for the schedule.
Translation Modules
The following classes are responsible for translating Kedro concepts into Dagster constructs:
KedroProjectTranslator
Translates an entire Kedro project into a Dagster code location, orchestrating the translation of pipelines, datasets, hooks, and loggers.
Translate Kedro project into Dagster code location.
Parameters:
-
project_path
(Path | None
, default:None
) –The path to the Kedro project.
-
env
(str | None
, default:None
) –Kedro environment to use.
-
conf_source
(str | None
, default:None
) –Path to the Kedro configuration source directory.
Source code in src/kedro_dagster/translator.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
get_defined_pipelines
get_defined_pipelines(dagster_config, translate_all)
Get pipelines to translate.
Parameters:
-
dagster_config
(dict[str, Any]
) –The configuration of the Dagster job.
-
translate_all
(bool
) –Whether to translate the whole Kedro project.
Returns:
-
list[Pipeline]
–List of Kedro pipelines to translate.
Source code in src/kedro_dagster/translator.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
initialize_kedro
initialize_kedro(conf_source=None)
Initialize Kedro context and pipelines for translation.
Parameters:
-
conf_source
(str | None
, default:None
) –Optional configuration source directory.
Source code in src/kedro_dagster/translator.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
to_dagster
to_dagster(translate_all=False)
Translate Kedro project into Dagster.
Parameters:
-
translate_all
(bool
, default:False
) –Whether to translate the whole Kedro project.
Returns:
-
DagsterCodeLocation
–The translated Dagster code location.
Source code in src/kedro_dagster/translator.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
|
DagsterCodeLocation
Collects the Dagster job, asset, resource, executor, schedule, sensor, and loggers definitions generated for the Kedro project-based Dagster code location.
Represents a Kedro-based Dagster code location.
Attributes:
-
named_ops
(dict[str, OpDefinition]
) –A dictionary of named Dagster operations.
-
named_assets
(dict[str, AssetSpec | AssetsDefinition]
) –A dictionary of named Dagster assets.
-
named_resources
(dict[str, ResourceDefinition]
) –A dictionary of named Dagster resources.
-
named_jobs
(dict[str, JobDefinition]
) –A dictionary of named Dagster jobs.
-
named_executors
(dict[str, ExecutorDefinition]
) –A dictionary of named Dagster executors.
-
named_schedules
(dict[str, ScheduleDefinition]
) –A dictionary of named Dagster schedules.
-
named_sensors
(dict[str, SensorDefinition]
) –A dictionary of named Dagster sensors.
-
named_loggers
(dict[str, LoggerDefinition]
) –A dictionary of named Dagster loggers.
CatalogTranslator
Translates Kedro datasets into Dagster IO managers and assets, enabling seamless data handling between Kedro and Dagster.
Translate Kedro datasets into Dagster IO managers.
Parameters:
-
catalog
(CatalogProtocol
) –The Kedro catalog.
-
pipelines
(list[Pipeline]
) –List of Kedro pipelines to translate.
-
hook_manager
(PluginManager
) –The hook manager to call Kedro hooks.
-
env
(str
) –The Kedro environment.
Source code in src/kedro_dagster/catalog.py
32 33 34 35 36 37 38 |
|
to_dagster
to_dagster()
Get the IO managers from Kedro datasets.
Returns:
-
Dict[str, IOManagerDefinition]
–A dictionary of DagsterIO managers.
Source code in src/kedro_dagster/catalog.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
NodeTranslator
Converts Kedro nodes into Dagster ops and assets, handling Kedro parameter passing.
Translate Kedro nodes into Dagster ops and assets.
Parameters:
-
pipelines
(list[Pipeline]
) –List of Kedro pipelines.
-
catalog
(CatalogProtocol
) –Kedro catalog instance.
-
hook_manager
(PluginManager
) –Kedro hook manager.
-
session_id
(str
) –Kedro session ID.
-
named_resources
(dict[str, ResourceDefinition]
) –Named Dagster resources.
-
env
(str
) –Kedro environment.
Source code in src/kedro_dagster/nodes.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
asset_names
property
asset_names
Return a list of all asset names in the pipelines.
create_asset
create_asset(node)
Create a Dagster asset from a Kedro node.
Parameters:
-
node
(Node
) –The Kedro node to wrap into an asset.
Returns:
-
AssetsDefinition
–A Dagster asset.
Source code in src/kedro_dagster/nodes.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
|
create_op
create_op(node)
Create a Dagster op from a Kedro node for use in a Dagster graph.
Parameters:
-
node
(Node
) –Kedro node.
Returns:
-
OpDefinition
–A Dagster op.
Source code in src/kedro_dagster/nodes.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
|
to_dagster
to_dagster()
Translate Kedro nodes into Dagster ops and assets.
Returns:
-
dict[str, OpDefinition]
–Dictionary of named ops.
-
dict[str, dg.AssetSpec | dg.AssetsDefinition]]
–Dictionary of named assets.
Source code in src/kedro_dagster/nodes.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
|
PipelineTranslator
Maps Kedro pipelines to Dagster jobs, supporting pipeline filtering, hooks, job configuration, and resource assignment.
Translator for Kedro pipelines to Dagster jobs.
Parameters:
-
dagster_config
(dict[str, Any]
) –The configuration of the Dagster job.
-
context
(KedroContext
) –The Kedro context.
-
project_path
(str
) –The path to the Kedro project.
-
env
(str
) –The Kedro environment.
-
session_id
(str
) –The Kedro session ID.
-
named_assets
(dict[str, AssetsDefinition]
) –The named assets.
-
named_ops
(dict[str, OpDefinition]
) –The named ops.
-
named_resources
(dict[str, ResourceDefinition]
) –The named resources.
-
named_executors
(dict[str, ExecutorDefinition]
) –The named executors.
Source code in src/kedro_dagster/pipelines.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
to_dagster
to_dagster()
Translate the Kedro pipelines into Dagster jobs.
Returns:
-
dict[str, JobDefinition]
–The translated Dagster jobs.
Source code in src/kedro_dagster/pipelines.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
|
translate_pipeline
translate_pipeline(pipeline, pipeline_name, filter_params, job_name, executor_def=None, logger_defs=None)
Translate a Kedro pipeline into a Dagster job.
Parameters:
-
pipeline
(Pipeline
) –The Kedro pipeline.
-
pipeline_name
(str
) –The name of the Kedro pipeline.
-
filter_params
(dict[str, Any]
) –Filter parameters for the pipeline.
-
job_name
(str
) –The name of the job.
-
executor_def
(ExecutorDefinition
, default:None
) –The executor definition.
-
logger_defs
(dict[str, LoggerDefinition] | None
, default:None
) –The logger definitions.
Returns:
-
JobDefinition
–A Dagster job definition.
Source code in src/kedro_dagster/pipelines.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
|
KedroRunTranslator
Manages translation of Kedro run parameters and hooks into Dagster resources and sensors, including error handling and context propagation.
Translator for Kedro run params.
Parameters:
-
context
(KedroContext
) –Kedro context.
-
project_path
(str
) –Path to the Kedro project.
-
env
(str
) –Kedro environment.
-
session_id
(str
) –Kedro session ID.
Source code in src/kedro_dagster/kedro.py
24 25 26 27 28 29 30 31 32 33 |
|
to_dagster
to_dagster(pipeline_name, filter_params)
Create a Dagster resource for Kedro pipeline hooks.
Parameters:
-
pipeline_name
(str
) –Name of the Kedro pipeline.
-
filter_params
(dict[str, Any]
) –Parameters used to filter the pipeline.
Returns:
-
ConfigurableResource
–A Dagster resource for Kedro pipeline hooks.
Source code in src/kedro_dagster/kedro.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
ExecutorCreator
Creates Dagster executors from configuration, allowing for granular execution strategies.
Creates Dagster executor definitions from Kedro configuration.
Parameters:
-
dagster_config
(BaseModel
) –The Dagster configuration.
Source code in src/kedro_dagster/dagster.py
45 46 |
|
create_executors
create_executors()
Create executor definitions from the configuration.
Returns:
-
Dict[str, ExecutorDefinition]
–A dict of executor definitions.
Source code in src/kedro_dagster/dagster.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
register_executor
register_executor(executor_option, executor)
Register an executor option with a Dagster executor.
Parameters:
-
executor_option
(BaseModel
) –The executor option to register.
-
executor
(ExecutorDefinition
) –The executor to register the option with.
Source code in src/kedro_dagster/dagster.py
48 49 50 51 52 53 54 55 |
|
LoggerTranslator
Translates Kedro loggers to Dagster loggers for unified logging across both frameworks.
Translates Kedro loggers to Dagster loggers.
Source code in src/kedro_dagster/dagster.py
132 133 134 |
|
to_dagster
to_dagster()
Translate Kedro loggers to Dagster loggers.
Source code in src/kedro_dagster/dagster.py
147 148 149 150 151 152 153 154 155 156 |
|
ScheduleCreator
Generates Dagster schedules from configuration, enabling automated pipeline execution.
Creates Dagster schedule definitions from Kedro configuration.
Source code in src/kedro_dagster/dagster.py
91 92 93 |
|
create_schedules
create_schedules()
Create schedule definitions from the configuration.
Returns:
-
Dict[str, ScheduleDefinition]
–A dict of schedule definitions.
Source code in src/kedro_dagster/dagster.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
Utilities
Helper functions for formatting, filtering, and supporting translation between Kedro and Dagster concepts.
Utility functions.
format_dataset_name
format_dataset_name(name)
Convert a dataset name so that it is valid under Dagster's naming convention.
Parameters:
-
name
(str
) –The name to format.
Returns:
-
str
–The formatted name.
Source code in src/kedro_dagster/utils.py
82 83 84 85 86 87 88 89 90 91 92 |
|
format_node_name
format_node_name(name)
Convert a node name so that it is valid under Dagster's naming convention.
Parameters:
-
name
(str
) –The node name to format.
Returns:
-
str
–The formatted name.
Source code in src/kedro_dagster/utils.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
get_asset_key_from_dataset_name
get_asset_key_from_dataset_name(dataset_name, env)
Get a Dagster AssetKey from a Kedro dataset name and environment.
Parameters:
-
dataset_name
(str
) –The Kedro dataset name.
-
env
(str
) –The Kedro environment.
Returns:
-
AssetKey
–The corresponding Dagster AssetKey.
Source code in src/kedro_dagster/utils.py
69 70 71 72 73 74 75 76 77 78 79 |
|
get_filter_params_dict
get_filter_params_dict(pipeline_config)
Extract filter parameters from a pipeline config dict.
Parameters:
-
pipeline_config
(dict[str, Any]
) –Pipeline configuration.
Returns:
-
dict[str, Any]
–Filter parameters.
Source code in src/kedro_dagster/utils.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
|
get_mlflow_resource_from_config
get_mlflow_resource_from_config(mlflow_config)
Create a Dagster resource definition from MLflow config.
Parameters:
-
mlflow_config
(BaseModel
) –MLflow configuration.
Returns:
-
ResourceDefinition
–Dagster resource definition for MLflow.
Source code in src/kedro_dagster/utils.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
is_mlflow_enabled
is_mlflow_enabled()
Check if MLflow is enabled in the Kedro context.
Returns:
-
bool
–True if MLflow is enabled, False otherwise.
Source code in src/kedro_dagster/utils.py
168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
render_jinja_template
render_jinja_template(src, is_cookiecutter=False, **kwargs)
Render a Jinja template from a file or string.
Parameters:
-
src
(str | Path
) –Path to the template file or template string.
-
is_cookiecutter
(bool
, default:False
) –Whether to use cookiecutter-style rendering.
-
**kwargs
–Variables to pass to the template.
Returns:
-
str
–Rendered template as a string.
Source code in src/kedro_dagster/utils.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
unformat_asset_name
unformat_asset_name(name)
Convert a Dagster-formatted asset name back to Kedro's naming convention.
Parameters:
-
name
(str
) –The Dagster-formatted name.
Returns:
-
str
–The original Kedro name.
Source code in src/kedro_dagster/utils.py
118 119 120 121 122 123 124 125 126 127 128 |
|
write_jinja_template
write_jinja_template(src, dst, **kwargs)
Render and write a Jinja template to a destination file.
Parameters:
-
src
(str | Path
) –Path to the template file.
-
dst
(str | Path
) –Path to the output file.
-
**kwargs
–Variables to pass to the template.
Source code in src/kedro_dagster/utils.py
55 56 57 58 59 60 61 62 63 64 65 66 |
|