diff --git a/airflow/providers/openlineage/extractors/base.py b/airflow/providers/openlineage/extractors/base.py index 3f455af86a0d3..c653638a564bc 100644 --- a/airflow/providers/openlineage/extractors/base.py +++ b/airflow/providers/openlineage/extractors/base.py @@ -67,7 +67,8 @@ def get_operator_classnames(cls) -> list[str]: @cached_property def disabled_operators(self) -> set[str]: return set( - operator.strip() for operator in conf.get("openlineage", "disabled_for_operators").split(";") + operator.strip() + for operator in conf.get("openlineage", "disabled_for_operators", fallback="").split(";") ) @cached_property diff --git a/airflow/providers/openlineage/plugins/adapter.py b/airflow/providers/openlineage/plugins/adapter.py index 0ea5d7213b1d9..f6e3c257e6d1c 100644 --- a/airflow/providers/openlineage/plugins/adapter.py +++ b/airflow/providers/openlineage/plugins/adapter.py @@ -88,13 +88,13 @@ def get_or_create_openlineage_client(self) -> OpenLineageClient: def get_openlineage_config(self) -> dict | None: # First, try to read from YAML file - openlineage_config_path = conf.get("openlineage", "config_path") + openlineage_config_path = conf.get("openlineage", "config_path", fallback="") if openlineage_config_path: config = self._read_yaml_config(openlineage_config_path) if config: return config.get("transport", None) # Second, try to get transport config - transport = conf.getjson("openlineage", "transport") + transport = conf.getjson("openlineage", "transport", fallback="") if not transport: return None elif not isinstance(transport, dict):