Skip to content

Commit

Permalink
dag_run.execution_date
Browse files Browse the repository at this point in the history
  • Loading branch information
laysabit committed Apr 19, 2024
1 parent 3053880 commit acc1d19
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dags/stellar_etl_airflow/test_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit acc1d19

Please sign in to comment.