首页 > 解决方案 > Airflow API 文档位置

问题描述

我知道这可能是一个不好的问题,但我仍然无法找到我需要的信息。对我来说,从任何气流导入中查看可用的每个功能的最佳方式是什么?例如,我有这两个 Airflow 类:

from airflow.models import Variable
environment = Variable.get("environment")

# and

from airflow import settings
session = settings.Session()

我想看看我能用这两个类做什么。我想查看所有代码可能性,因此我评估是否可以将它们用于我遇到的问题。

通常,我希望找到类似于此https://boto3.readthedocs.io/en/latest/reference/services/emr.html#EMR.Client.list_clusters或此https://docs.python.org/的页面3/library/signal.html仅作为示例。但是对于 Airflow,我能找到的只是这个https://airflow.apache.org/concepts.html#variables,它并没有向我展示 Variable 类的所有可能。我发现某些文件显示了这样的代码https://airflow.apache.org/_modules/airflow/models.html但即使对于该站点,我也找不到变量或设置类。

标签: airflow

解决方案


Airflow API 在此处有一个阅读文档部分:https ://airflow.readthedocs.io/en/latest/code.html

例如,您可以在此处查看变量页面:https ://airflow.readthedocs.io/en/latest/code.html#airflow.models.Variable

请注意,文档是由 Sphinx 从方法的文档字符串生成的,有些方法没有文档字符串。将 API 参考页面与源代码进行比较。


推荐阅读