tests.system.openlineage.operator
¶
Module Contents¶
Classes¶
This operator is added for system testing purposes. |
Functions¶
|
|
|
|
|
|
|
Use this jinja method to access the environment variable named 'var'. |
|
|
|
|
|
|
|
Check if result is "equal" to expected value. |
Attributes¶
- tests.system.openlineage.operator.env_var(var, default=None)[source]¶
Use this jinja method to access the environment variable named ‘var’.
If there is no such environment variable set, return the default. If the default is None, raise an exception for an undefined variable.
- tests.system.openlineage.operator.match(expected, result, env)[source]¶
Check if result is “equal” to expected value.
Omits keys not specified in expected value and resolves any jinja templates found.
- class tests.system.openlineage.operator.OpenLineageTestOperator(event_templates=None, file_path=None, env=setup_jinja(), allow_duplicate_events=False, clear_variables=True, **kwargs)[source]¶
Bases:
airflow.models.operator.BaseOperator
This operator is added for system testing purposes.
It compares expected event templates set on initialization with ones emitted by OpenLineage integration and stored in Variables by VariableTransport. :param event_templates: dictionary where key is the key used by VariableTransport in format of <DAG_ID>.<TASK_ID>.event.<EVENT_TYPE>, and value is event template (fragment) that need to be in received events. :param file_path: alternatively, file_path pointing to file with event templates will be used :param env: jinja environment used to render event templates :param allow_duplicate_events: if set to True, allows multiple events for the same key :param clear_variables: if set to True, clears all variables after checking events :raises: ValueError if the received events do not match with expected ones.