Skip to content

Commit b9879c2

Browse files
authored
🧹 CLONAGE: supprimer redondance dbt (#1571)
CLONAGE: supprimer redondance dbt
1 parent c37f6cc commit b9879c2

File tree

9 files changed

+1
-129
lines changed

9 files changed

+1
-129
lines changed

dags/clone/config/model.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55
from typing import Literal
66

7-
from pydantic import AnyUrl, BaseModel, computed_field, field_validator
7+
from pydantic import AnyUrl, BaseModel, computed_field
88

99
DIR_CURRENT = Path(__file__).resolve()
1010
DIR_SQL_CREATION = DIR_CURRENT.parent / "sql" / "creation"
@@ -23,8 +23,6 @@ class CloneConfig(BaseModel):
2323
file_unpacked: str
2424
delimiter: str
2525
run_timestamp: str
26-
dbt_build_skip: bool
27-
dbt_build_command: str
2826

2927
@computed_field
3028
@property
@@ -63,12 +61,3 @@ def validate_paths(self) -> None:
6361
raise FileNotFoundError(f"{self.table_schema_file_path=} pas trouvé")
6462
if not self.view_schema_file_path.exists():
6563
raise FileNotFoundError(f"{self.view_schema_file_path=} pas trouvé")
66-
67-
@field_validator("dbt_build_command", mode="after")
68-
@classmethod
69-
def validate_dbt_build_command(cls, value: str) -> str:
70-
if not value.strip():
71-
raise ValueError("dbt_build_command ne peut pas être vide")
72-
if not value.startswith("dbt "):
73-
raise ValueError("dbt_build_command doit commencer par 'dbt'")
74-
return value.strip()

dags/clone/config/tasks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ class TASKS:
1010
TABLE_VALIDATE = "clone_table_validate"
1111
VIEW_IN_USE_SWITCH = "clone_view_in_use_switch"
1212
OLD_TABLES_REMOVE = "clone_old_tables_remove"
13-
DBT_BUILD = "clone_dbt_build"

dags/clone/dags/clone_ae_etablissement.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@
6666
type="string",
6767
description_md="🔤 Délimiteur utilisé dans le fichier",
6868
),
69-
"dbt_build_skip": Param(
70-
False,
71-
type="boolean",
72-
description_md="🚫 Si coché, le build DBT ne sera pas exécuté",
73-
),
74-
"dbt_build_command": Param(
75-
"dbt build --select tag:ae,tag:etablissement",
76-
type="string",
77-
description_md="🔨 Commande DBT à exécuter",
78-
),
7969
},
8070
) as dag:
8171
chain_tasks(dag)

dags/clone/dags/clone_ae_unite_legale.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@
6666
type="string",
6767
description_md="🔤 Délimiteur utilisé dans le fichier",
6868
),
69-
"dbt_build_skip": Param(
70-
False,
71-
type="boolean",
72-
description_md="🚫 Si coché, la build DBT ne sera pas exécuté",
73-
),
74-
"dbt_build_command": Param(
75-
"dbt build --select tag:ae,tag:unite_legale",
76-
type="string",
77-
description_md="🔨 Commande DBT à exécuter",
78-
),
7969
},
8070
) as dag:
8171
chain_tasks(dag)

dags/clone/dags/clone_ban_adresses.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@
6666
type="string",
6767
description_md="🔤 Délimiteur utilisé dans le fichier",
6868
),
69-
"dbt_build_skip": Param(
70-
False,
71-
type="boolean",
72-
description_md="🚫 Si coché, le build DBT ne sera pas exécuté",
73-
),
74-
"dbt_build_command": Param(
75-
"dbt build --select tag:ban,tag:adresses",
76-
type="string",
77-
description_md="🔨 Commande DBT à exécuter",
78-
),
7969
},
8070
) as dag:
8171
chain_tasks(dag)

dags/clone/dags/clone_ban_lieux_dits.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@
6666
type="string",
6767
description_md="🔤 Délimiteur utilisé dans le fichier",
6868
),
69-
"dbt_build_skip": Param(
70-
False,
71-
type="boolean",
72-
description_md="🚫 Si coché, le build DBT ne sera pas exécuté",
73-
),
74-
"dbt_build_command": Param(
75-
"dbt build --select tag:ban,tag:lieux_dits",
76-
type="string",
77-
description_md="🔨 Commande DBT à exécuter",
78-
),
7969
},
8070
) as dag:
8171
chain_tasks(dag)

dags/clone/tasks/airflow_logic/chain_tasks.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
from clone.tasks.airflow_logic.clone_config_create_task import (
44
clone_config_create_task,
55
)
6-
7-
# from clone.tasks.airflow_logic.clone_dbt_command import (
8-
# dbt_command_task,
9-
# )
10-
from clone.tasks.airflow_logic.clone_dbt_build import clone_dbt_build_task
116
from clone.tasks.airflow_logic.clone_old_tables_remove_task import (
127
clone_old_tables_remove_task,
138
)
@@ -23,21 +18,10 @@
2318

2419

2520
def chain_tasks(dag: DAG) -> None:
26-
2721
chain(
2822
clone_config_create_task(dag),
2923
clone_table_create_task(dag),
3024
clone_table_validate_task(dag),
3125
clone_view_in_use_switch_task(dag),
3226
clone_old_tables_remove_task(dag),
33-
clone_dbt_build_task(dag),
3427
)
35-
36-
37-
"""
38-
dbt_command_task(
39-
dag,
40-
task_id="clone_dbt_build",
41-
cmd=dag.params["dbt_build_command"].strip(),
42-
),
43-
"""

dags/clone/tasks/airflow_logic/clone_dbt_build.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

dags_unit_tests/clone/test_config_model.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ def config(self):
1515
file_unpacked="data.csv",
1616
delimiter=",",
1717
run_timestamp="20220305120000",
18-
dbt_build_skip=False,
19-
dbt_build_command="dbt build --select tag:nothing_to_do",
2018
)
2119

2220
def test_table_name(self, config):

0 commit comments

Comments
 (0)