首页 > 其他分享 >Airflow - Study Notes 6

Airflow - Study Notes 6

时间:2025-01-20 13:20:51浏览次数:1  
标签:Airflow Study metrics airflow dashboard import Notes view

 

 

 

1. First, we will set up the imports that are required for the dashboard view:

from __future__ import annotations
from typing import TYPE_CHECKING
from airflow.auth.managers.models.resource_details import AccessView
from airflow.utils.session import NEW_SESSION, provide_session
from airflow.www.auth import has_access_view
from flask_appbuilder import BaseView, expose
from sqlalchemy import text

if TYPE_CHECKING:
    from sqlalchemy.orm import Session

 

2. Let’s set up the MetricsDashboardView class to define the route for the web view:

class MetricsDashboardView(BaseView):
    """A Flask-AppBuilder View for a metrics dashboard"""
    default_view = "index"
    route_base = "/metrics_dashboard"

 

3. Finally, the index function will execute the queries we need to run against the Airflow database to provide our metrics:

 

标签:Airflow,Study,metrics,airflow,dashboard,import,Notes,view
From: https://www.cnblogs.com/zhangzhihui/p/18681153

相关文章

  • Airflow - Study Notes 4
      Toretrievetheseimages,IfrequentlymakeuseoftheNASAAstronomyPictureoftheDayAPI (https://apod.nasa.gov/apod/astropix.html)togatheranewimage.Thisisafree APIrequiringanAPIkeytobecreatedbutiseasilyaccessible.  ......
  • Airflow - Study Notes 3
       (.venv)frank@ZZHUBT:~/venvs/my_airflow_project$airflowconfigget-valuecoreexecutorSequentialExecutor         ......
  • Airflow - Study Notes 1
    ApacheAirflowisknownwithinthedataengineeringcommunityasthego-toopensource platformfor“developing,scheduling,andmonitoringbatch-orientedworkflows.”       ......
  • day1-study markdown
    MARKDOWN学习标题标题:#+空格+标题名(一级标题)##+空格+标题名(二级标题)字体粗体:helloworld(****)斜体:helloworld(**)删除:helloworld(~~~~)引用坚持的男生最帅(>+空格+引用的话)分割线(三个减号线)图片(超链接哔哩哔哩([超链接名字](链接地址))列表......
  • PySpark - Study Notes 2
       ......
  • PySpark - Study Notes 1
     frank@ZZHUBT:~$dockerpulljupyter/pyspark-notebook dockerrun--namepyspark-notebook-p8888:8888-v~/dkvols/pyspark-notebook/:/home/jovyan/work/-djupyter/pyspark-notebook:latest frank@ZZHUBT:~$dockerlogspyspark-notebookEnteredstart.......
  • DuckDB - Study Notes 11
      (zpy310)frank@ZZHUBT:~$pipinstallduckdb(zpy310)frank@ZZHUBT:~$pipinstallharlequin......SuccessfullyinstalledMarkupSafe-3.0.2click-8.1.8harlequin-1.25.2jinja2-3.1.5linkify-it-py-2.0.3markdown-it-py-3.0.0mdit-py-plugins-0.4.2m......
  • DuckDB - Study Notes 8
         pi_relation=duckdb.sql("SELECTpi()ASpi")type(pi_relation)#duckdb.duckdb.DuckDBPyRelation pi_relation.show() ┌───────────────────┐│pi││double│├─────────......
  • Airflow:深入理解Airflow Sensor
    ApacheAirflowSensors是实现特定感知的任务,它可以持续监控外部条件或事件,并阻止下游任务的执行,直到满足指定的条件。它们对于编排复杂的工作流是必不可少的,在这些工作流中,任务需要在继续之前等待外部依赖关系变得可用。在这个全面的指南中,我们将详细探讨ApacheAirflowS......
  • Markdown-study
    Markdown-study标题一级标题一个#二级标题两个#三级标题三个#字体粗体左右两个*斜体左右一个*横线左右两个~引用一个>+空格即可分割线三个-或者三个*图片![图片](路径)超链接点击跳转列表数字+空格B减-+空格B表格右键插入即可......