Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

287
Views
Establecer variables en la variable de entorno en Airflow

Estoy creando un Airflow DAG para mi trabajo de pythin. Estos trabajos crean archivos json en el depósito s3 con la fecha actual. Estoy planeando pasar la fecha como variable de entorno. ¿Es posible hacerlo? lo que estoy intentando está debajo

 recommendations = KubernetesPodOperator( namespace='data', image = "quay.io/comp/data-rp-recommender:0.1.1", name = "data-rp-recommender-run", task_id = "data-rp-recommender-task", dag = dag, get_logs = True, in_cluster = True, is_delete_operator_pod = False, volumes = [ Volume( name = 'etcctek', ) ], volume_mounts = [ VolumeMount( name = 'etcctek', mount_path = '/opt/docker/etc', sub_path = None, read_only = True ) ], env_vars = { 'DATE' : 'USER_PRECEDING_STATS_S3' : 's3a://ml/rp-recommendations/userPreceedingStats/int/DATE/json' 'NUGGET_CATEGORICALS_S3' : 's3a://ml/rp-recommendations/nuggetCategorials/int/DATE/json' 'PREREQUISITE_STATS_S3' : 's3a://ml/rp-recommendations/prerequisiteStats/int/DATE/json' 'USER_CURRENT_STATS_S3' : 's3a://ml/rp-recommendations/userCurrentStats/int/DATE/json' }, resources = { 'request_memory': '2048M', 'request_cpu': '1.5' } )

En el ejemplo anterior, quiero configurar env_vars para DATE como fecha actual y luego usar esa fecha actual en otras variables a continuación. Es mi primera vez en el flujo de aire y necesita ayuda.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Suponiendo que desea escribir la hora de inicio de ejecución de la tarea:

 var = '{{ ti.start_date }}'

Más detalles sobre el modelo de instancia de tarea aquí

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!