Skip to content

Commit

Permalink
Remove unnecessary stack trace from Cosmos initialization (#624)
Browse files Browse the repository at this point in the history
As of Cosmos 1.2.0, whenever imported, the library would print a long
stack trace related to Openlineage if it was not available as a warning.

Change only to print the stack trace if DEBUG log mode is used.
  • Loading branch information
tatiana authored Oct 25, 2023
1 parent 682fc67 commit a4aa5cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cosmos/operators/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
from openlineage.airflow.extractors.base import OperatorLineage
except (ImportError, ModuleNotFoundError):
logger.warning(
"To enable emitting Openlineage events, upgrade to Airflow 2.7 or install astronomer-cosmos[openlineage].",
"To enable emitting Openlineage events, upgrade to Airflow 2.7 or install astronomer-cosmos[openlineage]."
)
logger.debug(
"Further details on lack of Openlineage:",
stack_info=True,
)
is_openlineage_available = False
Expand Down

0 comments on commit a4aa5cc

Please sign in to comment.