Skip to content

Commit

Permalink
Merge pull request #710 from MTES-MCT/fix-natural-keys
Browse files Browse the repository at this point in the history
Supprime l'étape DBT d'ingest_admin_express
  • Loading branch information
alexisig authored Nov 5, 2024
2 parents 1105358 + 2f31e6d commit 68b2cfb
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions airflow/dags/ingest_admin_express.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from airflow.decorators import dag, task
from airflow.models.param import Param
from include.container import Container
from include.pools import DBT_POOL
from pendulum import datetime

with open("include/admin_express/sources.json", "r") as f:
Expand Down Expand Up @@ -102,19 +101,12 @@ def ingest(path_on_bucket, **context) -> str:
]
subprocess.run(" ".join(cmd), shell=True, check=True)

@task.bash(retries=0, trigger_rule="all_success", pool=DBT_POOL)
def dbt_run(**context):
dbt_selector = get_source_by_name(context["params"]["zone"])["dbt_selector"]
dbt_run_cmd = f"dbt build -s {dbt_selector}"
return 'cd "${AIRFLOW_HOME}/include/sql/sparte" && ' + dbt_run_cmd

@task.bash
def cleanup() -> str:
return f"rm -rf {tmp_path}"

path_on_bucket = download_admin_express()
ingest_result = ingest(path_on_bucket)
ingest_result >> dbt_run()
ingest_result >> cleanup()


Expand Down

0 comments on commit 68b2cfb

Please sign in to comment.