在Apache Airflow上启用数据分析

时间:2019-07-24 13:34:03

标签: airflow adhoc-queries

数据配置文件虽然存在于documentation中,但在全新安装中不可见。有没有启用它的方法,或者它已被弃用?如果有帮助,则安装的版本为apache-airflow==1.10.3

2 个答案:

答案 0 :(得分:2)

在安装airflow v1.10.3时,数据配置文件是默认UI。

如果看不到数据配置文件菜单,则可能需要仔细检查第三方是否为您定制了气流。 气流使用烧瓶作为网络框架。您可以转到相关文件夹以查看是否已修改。 配置文件位于[您的气流源代码文件夹] \ www \ app.py


谢谢您的投票。 与数据分析相关的默认app.py部分如下:


div1 = div\
    .to_html()\
    .replace('<table border="1" class="dataframe">','<table class="table table-striped">')

从上面的代码中可以看到,它与安全模式有关。       如果不是conf.getboolean('core','secure_mode'): 您可能还需要检查安全模式配置。

注意:请检查airflow.cfg中的secure_mode是否正确配置。

数据分析只能以 secure_mode = False显示。

 with app.app_context():
        from airflow.www import views

        admin = Admin(
            app, name='Airflow',
            static_url_path='/admin',
            index_view=views.HomeView(endpoint='', url='/admin', name="DAGs"),
            template_mode='bootstrap3',
        )
        av = admin.add_view
        vs = views
        av(vs.Airflow(name='DAGs', category='DAGs'))

        if not conf.getboolean('core', 'secure_mode'):
            print("create_app", __file__)
            av(vs.QueryView(name='Ad Hoc Query', category="Data Profiling"))
            av(vs.ChartModelView(
                models.Chart, Session, name="Charts", category="Data Profiling"))
        av(vs.KnownEventView(
            models.KnownEvent,
            Session, name="Known Events", category="Data Profiling"))

答案 1 :(得分:2)

Airflow 2 disabled Data Profiling due to security reasons:(Breaking changes 部分)

<块引用>

出于安全考虑,新的 Web 服务器将不再支持旧 UI 的数据分析菜单中的功能,包括临时查询、图表和已知事件。