From 9ef0af15b4316f101ff0b113fde1bb377be9015d Mon Sep 17 00:00:00 2001 From: GiovanniCorsetti <66136602+CorsettiS@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:23:59 +0100 Subject: [PATCH 1/5] update openlineage to avoid deprecation warning openlineage suggests using event_v2 as the new import call UserWarning: {message : DeprecationWarning('This module is deprecated. Please use `openlineage.client.event_v2`.'), category : 'DeprecationWarning', filename : '/home/airflow/.local/lib/python3.10/site-packages/openlineage/client/filter.py', lineno : 9, line : None} --- cosmos/operators/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosmos/operators/local.py b/cosmos/operators/local.py index c5d47dd48..50c2f5802 100644 --- a/cosmos/operators/local.py +++ b/cosmos/operators/local.py @@ -46,7 +46,7 @@ if TYPE_CHECKING: from airflow.datasets import Dataset # noqa: F811 from dbt.cli.main import dbtRunner, dbtRunnerResult - from openlineage.client.run import RunEvent + from openlineage.client.event_v2 import RunEvent from sqlalchemy.orm import Session From 6b0913144cff3e63d8f1f64608421bc8d89ec859 Mon Sep 17 00:00:00 2001 From: GiovanniCorsetti <66136602+CorsettiS@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:05:05 +0100 Subject: [PATCH 2/5] Update local.py --- cosmos/operators/local.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cosmos/operators/local.py b/cosmos/operators/local.py index 50c2f5802..1a1b549f1 100644 --- a/cosmos/operators/local.py +++ b/cosmos/operators/local.py @@ -46,7 +46,10 @@ if TYPE_CHECKING: from airflow.datasets import Dataset # noqa: F811 from dbt.cli.main import dbtRunner, dbtRunnerResult - from openlineage.client.event_v2 import RunEvent + try: + from openlineage.client.event_v2 import RunEvent + except ImportError: + from openlineage.client.run import RunEvent from sqlalchemy.orm import Session From 75d0f459b2035856419b6c978c3450a995efc2a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:05:25 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20for?= =?UTF-8?q?mat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cosmos/operators/local.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cosmos/operators/local.py b/cosmos/operators/local.py index 1a1b549f1..68d99780a 100644 --- a/cosmos/operators/local.py +++ b/cosmos/operators/local.py @@ -46,6 +46,7 @@ if TYPE_CHECKING: from airflow.datasets import Dataset # noqa: F811 from dbt.cli.main import dbtRunner, dbtRunnerResult + try: from openlineage.client.event_v2 import RunEvent except ImportError: From ff8deafa77b649962ede26ec74302b2f529e13c6 Mon Sep 17 00:00:00 2001 From: GiovanniCorsetti <66136602+CorsettiS@users.noreply.github.com> Date: Fri, 17 Jan 2025 09:29:21 +0100 Subject: [PATCH 4/5] Update local.py --- cosmos/operators/local.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cosmos/operators/local.py b/cosmos/operators/local.py index 68d99780a..50d11ab13 100644 --- a/cosmos/operators/local.py +++ b/cosmos/operators/local.py @@ -47,10 +47,10 @@ from airflow.datasets import Dataset # noqa: F811 from dbt.cli.main import dbtRunner, dbtRunnerResult - try: - from openlineage.client.event_v2 import RunEvent - except ImportError: - from openlineage.client.run import RunEvent + try: # pragma: no cover + from openlineage.client.event_v2 import RunEvent # pragma: no cover + except ImportError: # pragma: no cover + from openlineage.client.run import RunEvent # pragma: no cover from sqlalchemy.orm import Session From bc947aeddd7a5fc01e453de6ab388f9938fb2e5f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 08:29:50 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20for?= =?UTF-8?q?mat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cosmos/operators/local.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cosmos/operators/local.py b/cosmos/operators/local.py index 50d11ab13..f0f4c2e87 100644 --- a/cosmos/operators/local.py +++ b/cosmos/operators/local.py @@ -47,10 +47,10 @@ from airflow.datasets import Dataset # noqa: F811 from dbt.cli.main import dbtRunner, dbtRunnerResult - try: # pragma: no cover - from openlineage.client.event_v2 import RunEvent # pragma: no cover - except ImportError: # pragma: no cover - from openlineage.client.run import RunEvent # pragma: no cover + try: # pragma: no cover + from openlineage.client.event_v2 import RunEvent # pragma: no cover + except ImportError: # pragma: no cover + from openlineage.client.run import RunEvent # pragma: no cover from sqlalchemy.orm import Session