helpers
Shared helper utilities used across Dagster definition factories and resources.
get_automation_condition_from_meta(meta)
Return an AutomationCondition if valid configuration is provided in the meta. Meta should be of format dict in the following structure: .. code-block:: python "meta":{ "dagster":{ "automation_condition": condition, "automation_condition_config": {argument: value} } }
Source code in data_platform_utils/helpers.py
get_database_name(database)
Return the database name adjusted for the current environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
database
|
str
|
Base database name configured for the deployment. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Database name optionally prefixed with |
str
|
environments. |
Source code in data_platform_utils/helpers.py
get_nested(config, path)
Helper function to safely traverse a nested dictionary that may have null values for a set key that is expected to be a dict. helpful because stream definitions that use only the default configs behave this way. .. code-block:: yaml streams: source.table_one: source.table_two:
Source code in data_platform_utils/helpers.py
get_partitions_def_from_meta(meta)
Return an TimeWindowPartitionsDefinition if valid configuration is provided in the meta. - partition accepts the values: hourly, daily, weekly, monthly. - partition_start_date should be a iso format date, or timestamp.
Meta should be of format dict in the following structure: .. code-block:: python "meta":{ "dagster":{ "partition": "daily", "partition_start_date": "2025-01-01" } }
Source code in data_platform_utils/helpers.py
get_schema_name(schema)
Return the schema name adjusted for the current environment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
str
|
Base schema name defined in configuration. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Schema name suffixed with the destination user when targeting |
str
|
ensure isolation between developers. |
Source code in data_platform_utils/helpers.py
sanitize_input_signature(func, kwargs)
Remove any arguments that are not expected by the receiving function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable
|
Callable whose signature should be respected. |
required |
kwargs
|
dict
|
Proposed keyword arguments to sanitize. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Filtered keyword arguments containing only parameters accepted by |
dict
|
|