简体   繁体   English

如何解码气流表 dag_run 列 conf 值

[英]How to decode airflow table dag_run column conf value

How do i decode the value of airflow table dag_run column conf value so I can read the value of conf column from the table我如何解码气流表 dag_run 列 conf 值的值,以便我可以从表中读取 conf 列的值

Thanks谢谢

I recently ran into the same thing, and it turns out the conf column is a binary Pickle string.我最近遇到了同样的事情,结果conf列是一个二进制 Pickle 字符串。

I found the answer in the Airflow internal module documentation https://airflow.apache.org/docs/apache-airflow/stable/_modules/airflow/models/dagrun.html#DagRun.conf我在 Airflow 内部模块文档https://airflow.apache.org/docs/apache-airflow/stable/_modules/airflow/models/dagrun.html#DagRun.conf中找到了答案

import pickle

# function to return SQLAlchemy Engine connected to Airflow
engine = get_airflow_db_engine()

# query and convert conf
query = """
    select dag_id, execution_date, state, run_id, conf
    from dag_run
    limit 25
"""
df = pd.read_sql(query, engine)
df['conf'] = df['conf'].apply(lambda x: pickle.loads(x))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 基于 dag_run conf 值的循环中的气流任务 - Airflow tasks in a loop based on dag_run conf value 是否可以更新/覆盖 Airflow ['dag_run'].conf? - Is it possible to update/overwrite the Airflow [‘dag_run’].conf? 气流配置数据库表dag_run中的end_date列为null - airflow metabase the column end_date in table dag_run is null 在气流 Dag 中使用 dag_run 变量 - Using dag_run variables in airflow Dag Airflow - 在通过 TriggerDagRunOperator 发送之前设置 dag_run conf 值 - Airflow - Set dag_run conf values before sending them through TriggerDagRunOperator 如果手动运行 DAG,Airflow 计划的 dag_run 时间会更改 - Airflow scheduled dag_run time changes if DAG is run manuallly 有些人可以为我提供在气流数据库中重新创建 dag_run 表的模式吗? - Can some provide me with the schema to recreate dag_run table in airflow-db.? 气流 - 如何获取当前 dag_run 的开始日期(不是特定任务)? - airflow - how to get start date of current dag_run (not specific task)? 如何从 airflow dag 获取 conf 值? - How to get conf value from airflow dag? Apache Airflow-如何在使用TriggerDagRunOperator触发的流中在运算符外部检索dag_run数据 - Apache Airflow - How to retrieve dag_run data outside an operator in a flow triggered with TriggerDagRunOperator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM