Debuggen en problemen oplossen in Airflow

Introductie tot Apache Airflow in Python

Mike Metzger

Data Engineer

Typische problemen...

  • DAG draait niet volgens schema
  • DAG laadt niet
  • Syntaxfouten
Introductie tot Apache Airflow in Python

DAG draait niet volgens schema

  • Check of de scheduler draait

Airflow-scheduler draait niet

  • Los op door airflow scheduler via de commandoregel te draaien.
Introductie tot Apache Airflow in Python

DAG draait niet volgens schema (deel 2)

  • Er is nog geen schedule_interval verstreken.
    • Pas de attributen aan naar je behoefte.
  • Te weinig vrije taken in de executor.
    • Wijzig het executortype
    • Voeg systeembronnen toe
    • Voeg meer systemen toe
    • Pas DAG-planning aan
Introductie tot Apache Airflow in Python

DAG laadt niet

  • DAG niet in web-UI
  • DAG niet in airflow dags list

Mogelijke oplossingen

  • Controleer of het DAG-bestand in de juiste map staat
  • Vind de DAGs-map via airflow.cfg
  • Let op: het pad moet absoluut zijn

Airflow dags_folder

Introductie tot Apache Airflow in Python

Syntaxfouten

  • De meest voorkomende reden dat een DAG-bestand niet verschijnt
  • Fouten in een DAG zijn soms lastig te vinden
  • Twee snelle methoden:

    • Voer airflow dags list-import-errors uit

    • Voer python3 <dagfile.py> uit

Introductie tot Apache Airflow in Python

airflow dags list-import-errors

airflow dags list-import-errors met fouten

Introductie tot Apache Airflow in Python

De Python-interpreter draaien

python3 dagfile.py:

  • Met fouten

python3 - fouten

  • Zonder fouten

python3 - geen fouten

Introductie tot Apache Airflow in Python

Laten we oefenen!

Introductie tot Apache Airflow in Python

Preparing Video For Download...