Skip to content

Commit b073689

Browse files
ashbnailo2c
authored andcommitted
Stop trying to reconfigure the ORM in the OpenLineage workers (apache#47580)
The error was "ArgumentError: Could not parse SQLAlchemy URL from string 'airflow-db-not-allowed:///'" from this ``` /usr/local/lib/python3.12/site-packages/airflow/providers/openlineage/plugins/listener.py:244 in on_task_instance_success /usr/local/lib/python3.12/site-packages/airflow/providers/openlineage/plugins/listener.py:326 in _on_task_instance_success /usr/local/lib/python3.12/site-packages/airflow/providers/openlineage/plugins/listener.py:452 in _execute /usr/local/lib/python3.12/site-packages/airflow/providers/openlineage/plugins/listener.py:484 in _fork_execute /usr/local/lib/python3.12/site-packages/airflow/settings.py:363 in configure_orm <string>:2 in create_engine /usr/local/lib/python3.12/site-packages/sqlalchemy/util/deprecations.py:375 in warned /usr/local/lib/python3.12/site-packages/sqlalchemy/engine/create.py:514 in create_engine /usr/local/lib/python3.12/site-packages/sqlalchemy/engine/url.py:738 in make_url /usr/local/lib/python3.12/site-packages/sqlalchemy/engine/url.py:799 in _parse_url ```
1 parent c46d980 commit b073689

File tree

1 file changed

+4
-2
lines changed
  • providers/openlineage/src/airflow/providers/openlineage/plugins

1 file changed

+4
-2
lines changed

providers/openlineage/src/airflow/providers/openlineage/plugins/listener.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def _executor_initializer():
7676
Reconfigures the ORM engine to prevent issues that arise when multiple processes interact with
7777
the Airflow database.
7878
"""
79-
settings.configure_orm()
79+
if not AIRFLOW_V_3_0_PLUS:
80+
settings.configure_orm()
8081

8182

8283
class OpenLineageListener:
@@ -481,7 +482,8 @@ def _fork_execute(self, callable, callable_name: str):
481482
self.log.debug("Process with pid %s finished - parent", pid)
482483
else:
483484
setproctitle(getproctitle() + " - OpenLineage - " + callable_name)
484-
configure_orm(disable_connection_pool=True)
485+
if not AIRFLOW_V_3_0_PLUS:
486+
configure_orm(disable_connection_pool=True)
485487
self.log.debug("Executing OpenLineage process - %s - pid %s", callable_name, os.getpid())
486488
callable()
487489
self.log.debug("Process with current pid finishes after %s", callable_name)

0 commit comments

Comments
 (0)