Skip to content

Commit

Permalink
Remove unnecssary logging in experimental API
Browse files Browse the repository at this point in the history
The `execution_data` does not need to be passed to log. We send enough details to the API user in the response.
  • Loading branch information
kaxil committed Dec 17, 2021
1 parent 4fc0530 commit 6449f73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions airflow/www/api/experimental/endpoints.py
Expand Up @@ -103,11 +103,11 @@ def trigger_dag(dag_id):
try:
execution_date = timezone.parse(execution_date)
except ValueError:
log.error("Given execution date could not be identified as a date.")
error_message = (
f'Given execution date, {execution_date}, could not be identified as a date. '
f'Example date format: 2015-11-16T14:34:15+00:00'
)
log.error(error_message)
response = jsonify({'error': error_message})
response.status_code = 400

Expand Down Expand Up @@ -253,11 +253,11 @@ def task_instance_info(dag_id, execution_date, task_id):
try:
execution_date = timezone.parse(execution_date)
except ValueError:
log.error("Given execution date could not be identified as a date.")
error_message = (
f'Given execution date, {execution_date}, could not be identified as a date. '
f'Example date format: 2015-11-16T14:34:15+00:00'
)
log.error(error_message)
response = jsonify({'error': error_message})
response.status_code = 400

Expand Down Expand Up @@ -289,11 +289,11 @@ def dag_run_status(dag_id, execution_date):
try:
execution_date = timezone.parse(execution_date)
except ValueError:
log.error("Given execution date could not be identified as a date.")
error_message = (
f'Given execution date, {execution_date}, could not be identified as a date. '
f'Example date format: 2015-11-16T14:34:15+00:00'
)
log.error(error_message)
response = jsonify({'error': error_message})
response.status_code = 400

Expand Down Expand Up @@ -402,11 +402,11 @@ def get_lineage(dag_id: str, execution_date: str):
try:
execution_dt = timezone.parse(execution_date)
except ValueError:
log.error("Given execution date could not be identified as a date.")
error_message = (
f'Given execution date, {execution_date}, could not be identified as a date. '
f'Example date format: 2015-11-16T14:34:15+00:00'
)
log.error(error_message)
response = jsonify({'error': error_message})
response.status_code = 400

Expand Down

0 comments on commit 6449f73

Please sign in to comment.