gfw.common.config.PipelineConfig#
- class PipelineConfig(*, date_range, name='', version='0.1.0', jinja_folder='assets/queries', mock_bq_clients=False, unknown_parsed_args=<factory>, unknown_unparsed_args=())[source]#
Configuration object for data pipeline execution.
Note
This class is completely generic and independent of any specific pipeline framework.
Methods
Creates a
PipelineConfiginstance from atypes.SimpleNamespace.Converts a
PipelineConfiginstance to dictionary.Attributes
Returns the end date of the configured range.
Returns a default jinja2 environment.
The folder that contains the jinja2 templates.
If True, all BigQuery interactions will be mocked.
Name of the pipeline.
Returns the parsed start and end dates as
dateobjects.Sequence of callables executed after successful pipeline run.
Sequence of callables executed before pipeline run.
Returns the start date of the configured range.
Returns the top-level package from this module.
Raw unparsed CLI arguments.
Version of the pipeline.
Tuple of start and end dates in ISO format (
YYYY-MM-DD).Parsed CLI or config arguments not explicitly defined in self.
- classmethod from_namespace(ns, **kwargs)[source]#
Creates a
PipelineConfiginstance from atypes.SimpleNamespace.- Parameters:
ns (SimpleNamespace) – Namespace containing attributes matching this
PipelineConfigfields.**kwargs (Any) – Any additional arguments to be passed to the class constructor.
- Returns:
A new
PipelineConfiginstance.- Return type:
- property parsed_date_range: tuple[date, date]#
Returns the parsed start and end dates as
dateobjects.- Raises:
PipelineConfigError – If any of the dates are not in valid ISO format.
- Returns:
A tuple containing parsed start and end dates.
- property jinja_env: Environment#
Returns a default jinja2 environment.
- property start_date: date#
Returns the start date of the configured range.
- Returns:
A
dateobject representing the start of the range.
- property end_date: date#
Returns the end date of the configured range.
- Returns:
A
dateobject representing the end of the range.
- property pre_hooks: Sequence[Callable[[Any], None]]#
Sequence of callables executed before pipeline run.