From acc1d198f54cf8852a0ad4836a847281c0e550ab Mon Sep 17 00:00:00 2001 From: Laysa de Sousa Bitencourt Date: Fri, 19 Apr 2024 11:42:55 -0300 Subject: [PATCH] dag_run.execution_date --- dags/stellar_etl_airflow/test_sources.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dags/stellar_etl_airflow/test_sources.py b/dags/stellar_etl_airflow/test_sources.py index 2b24b418..4f9bcceb 100644 --- a/dags/stellar_etl_airflow/test_sources.py +++ b/dags/stellar_etl_airflow/test_sources.py @@ -40,13 +40,14 @@ def get_from_combinedExport(**context): gcs_hook = GCSHook(google_cloud_storage_conn_id="google_cloud_storage_default") for dag_run in execution_dates: + dag_run.execution_date = dag_run.execution_date.replace(" ", "T") print(dag_run.execution_date) - # Download the file and get its content, it runs 47 times day 16th of april - file_content = gcs_hook.download( - bucket_name="us-central1-test-hubble-2-5f1f2dbf-bucket", - object_name="logs/dag_id=history_archive_with_captive_core_combined_export/run_id=scheduled__2024-04-16T00:00:00+00:00/task_id=export_all_history_task/attempt=1.log", - ) + # Download the file and get its content, it runs 47 times day 16th of april + file_content = gcs_hook.download( + bucket_name="us-central1-test-hubble-2-5f1f2dbf-bucket", + object_name="logs/dag_id=history_archive_with_captive_core_combined_export/run_id=scheduled__{dag_run.execution_date}/task_id=export_all_history_task/attempt=1.log", + ) # Decode the bytes object to a string file_content = file_content.decode()