Skip to content

Commit

Permalink
remove PY2 references from parse iso method and add links to document…
Browse files Browse the repository at this point in the history
…ation for auth_backend(s) config
  • Loading branch information
Kyle-Neale committed Feb 12, 2024
1 parent e4ac240 commit 7c9a2e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions airflow/datadog_checks/airflow/airflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,8 @@ def _get_seconds_from_iso(self, iso_string):
"""
Returns the number of seconds since the Unix epoch for a given ISO datetime string.
"""

def parse_iso_string(iso_string):
if PY3:
return datetime.fromisoformat(iso_string)
else:
return datetime.strptime(iso_string, '%Y-%m-%dT%H:%M:%S.%f%z') # Updated format
return datetime.fromisoformat(iso_string)

dt = parse_iso_string(iso_string)
return dt
Expand Down
2 changes: 2 additions & 0 deletions airflow/metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ airflow.pool.running_slots,gauge,,,,Number of running slots in the pool,0,airflo
airflow.pool.starving_tasks,gauge,,task,,Number of starving tasks in the pool,-1,airflow,pool.starving_tasks,
airflow.dagrun.dependency_check,gauge,,millisecond,,Milliseconds taken to check DAG dependencies,-1,airflow,dagrun.dep_check,
airflow.dag.task.duration,gauge,,millisecond,,Milliseconds taken to finish a task,-1,airflow,dag.task.duration,
airflow.dag.task.ongoing_duration,gauge,,second,,Current duration for ongoing DAG tasks,-1,airflow,dag.task.ongoing_duration,
airflow.dag.task.total_running,gauge,,,,Total number of running tasks,-1,airflow,dag.task.total_running,
airflow.dag_processing.last_duration,gauge,,millisecond,,Milliseconds taken to load the given DAG file,-1,airflow,dag_proc.last_duration,
airflow.dagrun.duration.success,gauge,,millisecond,,Milliseconds taken for a DagRun to reach success state,-1,airflow,dagrun.duration.success,
airflow.dagrun.duration.failed,gauge,,millisecond,,Milliseconds taken for a DagRun to reach failed state,-1,airflow,dagrun.duration.failed,
Expand Down
2 changes: 2 additions & 0 deletions airflow/tests/compose/config/airflow.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,11 @@ enable_experimental_api = True
# ("airflow.api.auth.backend.default" allows all requests for historic reasons)

# Airflow 2.1 E2E
# https://airflow.apache.org/docs/apache-airflow/2.1.0/administration-and-deployment/security/api.html
auth_backend = airflow.api.auth.backend.basic_auth

# Airflow 2.6+ E2E
# https://airflow.apache.org/docs/apache-airflow/2.6.0/administration-and-deployment/security/api.html
auth_backends = airflow.api.auth.backend.basic_auth

# Used to set the maximum page limit for API requests. If limit passed as param
Expand Down

0 comments on commit 7c9a2e2

Please sign in to comment.