Skip to content

Commit

Permalink
type(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 acc1d19 commit fd80898
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dags/stellar_etl_airflow/test_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ 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)
execution_date_str = dag_run.execution_date.strftime(
"%Y-%m-%d %H:%M:%S%z"
).replace(" ", "T")
print(f" EM STRING É:{execution_date_str}")
print(type(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__{dag_run.execution_date}/task_id=export_all_history_task/attempt=1.log",
object_name="logs/dag_id=history_archive_with_captive_core_combined_export/run_id=scheduled__{execution_date_str}/task_id=export_all_history_task/attempt=1.log",
)

# Decode the bytes object to a string
Expand Down

0 comments on commit fd80898

Please sign in to comment.