tests.system.openlineage.operator¶
属性¶
类¶
添加此操作符是为了进行系统测试。 |
函数¶
|
|
|
|
|
|
|
|
|
使用此 jinja 方法访问名为 'var' 的环境变量。 |
|
|
|
|
|
|
|
检查 result 是否与 expected 值“相等”。 |
模块内容¶
- tests.system.openlineage.operator.env_var(var, default=None)[source]¶
使用此 jinja 方法访问名为 'var' 的环境变量。
如果未设置此类环境变量,则返回默认值。如果默认值为 None,则针对未定义的变量引发异常。
- tests.system.openlineage.operator.match(expected, result, env)[source]¶
检查 result 是否与 expected 值“相等”。
忽略 expected 值中未指定的键,并解析找到的任何 jinja 模板。
- class tests.system.openlineage.operator.OpenLineageTestOperator(event_templates=None, file_path=None, env=setup_jinja(), allow_duplicate_events=False, clear_variables=True, **kwargs)[source]¶
基类:
airflow.models.operator.BaseOperator
添加此操作符是为了进行系统测试。
它将初始化时设置的 expected 事件模板与 OpenLineage 集成发出并通过 VariableTransport 存储在 Variables 中的事件模板进行比较。 :param event_templates: 字典,其中 key 是 VariableTransport 使用的格式为 <DAG_ID>.<TASK_ID>.event.<EVENT_TYPE> 的 key,value 是需要在接收到的事件中存在的事件模板(片段)。 :param file_path: 或者,将使用指向包含事件模板的文件的 file_path。 :param env: 用于渲染事件模板的 jinja 环境。 :param allow_duplicate_events: 如果设置为 True,则允许同一 key 存在多个事件。 :param clear_variables: 如果设置为 True,则在检查事件后清除所有 Variables。 :raises: 如果接收到的事件与 expected 事件不匹配,则引发 ValueError。