Skip to content

Commit

Permalink
Fix OpenLineage deprecation warning (#1449)
Browse files Browse the repository at this point in the history
Openlineage suggests using event_v2 as the new import call. This can be
seen in the source code of openlineage itself for the
[run](https://github.com/OpenLineage/OpenLineage/blob/main/client/python/openlineage/client/run.py)
method.

```
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}
``

Co-authored-by: Giovanni Corsetti <155465603+corsettigyg@users.noreply.github.com>
  • Loading branch information
CorsettiS and corsettigyg authored Jan 24, 2025
1 parent 7467e11 commit 2b99777
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cosmos/operators/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@
if TYPE_CHECKING:
from airflow.datasets import Dataset # noqa: F811
from dbt.cli.main import dbtRunner, dbtRunnerResult
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
Expand Down

0 comments on commit 2b99777

Please sign in to comment.