小编Sam*_*Sam的帖子

如何在Unix中获得GMT时间?

如果我的Unix机器设置为IST时区,我如何获得当前的GMT时间?

unix linux date unix-timestamp

41
推荐指数
4
解决办法
5万
查看次数

Airflow 将 jinja 模板作为字符串

在 Airflow 中,我尝试在 Airflow 中使用 jinja 模板,但问题是它没有被解析,而是被视为字符串。请看我的代码``

from datetime import datetime

from airflow.operators.python_operator import PythonOperator
from airflow.models import DAG

def test_method(dag,network_id,schema_name):
    print "Schema_name in test_method", schema_name
    third_task = PythonOperator(
        task_id='first_task_' + network_id,
        provide_context=True,
        python_callable=print_context2,
        dag=dag)
    return third_task

dag = DAG('testing_xcoms_pull', description='Testing Xcoms',
          schedule_interval='0 12 * * *',
          start_date= datetime.today(),
          catchup=False)


def print_context(ds, **kwargs):
    return 'Returning from print_context'

def print_context2(ds, **kwargs):
    return 'Returning from print_context2'

def get_schema(ds, **kwargs):
    # Returning schema name based on network_id
    schema_name = "my_schema"
    return get_schema

first_task …
Run Code Online (Sandbox Code Playgroud)

airflow

5
推荐指数
1
解决办法
7437
查看次数

标签 统计

airflow ×1

date ×1

linux ×1

unix ×1

unix-timestamp ×1