Skip to content

Commit

Permalink
Change log levels to analyse behaviour in Astro CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana committed Dec 20, 2024
1 parent 8919ef0 commit aaa19da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions cosmos/listeners/dag_run_listener.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

import functools

from airflow.listeners import hookimpl
from airflow.models.dag import DAG
from airflow.models.dagrun import DagRun
Expand All @@ -27,7 +25,6 @@ def is_cosmos_dag(dag: DAG) -> bool:


def total_cosmos_task_groups(dag: DAG) -> int:

cosmos_task_groups = 0
for group_id, task_group in dag.task_group_dict.items():
if task_group.__class__.__module__.startswith("cosmos."):
Expand All @@ -45,7 +42,6 @@ def total_cosmos_tasks(dag: DAG) -> int:
return cosmos_tasks


@functools.lru_cache()
def uses_cosmos(dag: DAG) -> bool:
return bool(is_cosmos_dag(dag) or total_cosmos_task_groups(dag) or total_cosmos_tasks(dag))

Expand Down
4 changes: 2 additions & 2 deletions cosmos/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def emit_usage_metrics(metrics: dict[str, object]) -> bool:
telemetry_url = constants.TELEMETRY_URL.format(
**metrics, telemetry_version=constants.TELEMETRY_VERSION, query_string=query_string
)
logging.debug("Telemetry is enabled. Emitting the following usage metrics to %s: %s", telemetry_url, metrics)
logging.info("Telemetry is enabled. Emitting the following usage metrics to %s: %s", telemetry_url, metrics)
response = httpx.get(telemetry_url, timeout=constants.TELEMETRY_TIMEOUT, follow_redirects=True)
if not response.is_success:
logging.warning(
Expand All @@ -71,5 +71,5 @@ def emit_usage_metrics_if_enabled(event_type: str, additional_metrics: dict[str,
is_success = emit_usage_metrics(metrics)
return is_success
else:
logging.debug("Telemetry is disabled. To enable it, export AIRFLOW__COSMOS__ENABLE_TELEMETRY=True.")
logging.info("Telemetry is disabled. To enable it, export AIRFLOW__COSMOS__ENABLE_TELEMETRY=True.")
return False

0 comments on commit aaa19da

Please sign in to comment.