add sustainability ind version
This commit is contained in:
@@ -51,10 +51,9 @@ Scripts folder harus berisi:
|
|||||||
- bigquery_helpers.py
|
- bigquery_helpers.py
|
||||||
- bigquery_datasource.py
|
- bigquery_datasource.py
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from airflow import DAG
|
from airflow import DAG
|
||||||
from airflow.operators.python import PythonOperator
|
from airflow.operators.python import PythonOperator
|
||||||
from datetime import datetime
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from scripts.bigquery_raw_layer import (
|
from scripts.bigquery_raw_layer import (
|
||||||
run_verify_connection,
|
run_verify_connection,
|
||||||
@@ -63,37 +62,25 @@ from scripts.bigquery_raw_layer import (
|
|||||||
run_load_unicef,
|
run_load_unicef,
|
||||||
run_staging_integration,
|
run_staging_integration,
|
||||||
)
|
)
|
||||||
from scripts.bigquery_cleaned_layer import (
|
from scripts.bigquery_cleaned_layer import run_cleaned_integration
|
||||||
run_cleaned_integration,
|
from scripts.bigquery_dimensional_model import run_dimensional_model
|
||||||
)
|
from scripts.bigquery_analytical_layer import run_analytical_layer
|
||||||
from scripts.bigquery_dimensional_model import (
|
from scripts.bigquery_aggregate_layer import run_aggregation
|
||||||
run_dimensional_model,
|
from scripts.bigquery_aggraget_fact_selected_layer import run_indicator_norm_aggregation
|
||||||
)
|
|
||||||
from scripts.bigquery_analytical_layer import (
|
|
||||||
run_analytical_layer,
|
|
||||||
)
|
|
||||||
from scripts.bigquery_aggregate_layer import (
|
|
||||||
run_aggregation,
|
|
||||||
)
|
|
||||||
from scripts.bigquery_aggraget_fact_selected_layer import (
|
|
||||||
run_indicator_norm_aggregation,
|
|
||||||
)
|
|
||||||
|
|
||||||
# DEFAULT ARGS
|
# DEFAULT ARGS
|
||||||
|
|
||||||
default_args = {
|
default_args = {
|
||||||
'owner': 'Debby Seftia',
|
'owner': 'Debby Seftia',
|
||||||
'email': ['d1041221004@student.untan.ac.id'],
|
'email': ['d1041221004@student.untan.ac.id'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# DAG DEFINITION
|
# DAG DEFINITION
|
||||||
|
|
||||||
with DAG(
|
with DAG(
|
||||||
dag_id = "etl_food_security_bigquery",
|
dag_id = "etl_food_security_bigquery",
|
||||||
description = "Kimball ETL: FAO, World Bank, UNICEF → BigQuery (Bronze → Silver → Gold)",
|
description = "Kimball ETL: FAO, World Bank, UNICEF → BigQuery (Bronze → Silver → Gold)",
|
||||||
default_args = default_args,
|
default_args = default_args,
|
||||||
start_date = datetime(2026, 3, 1),
|
start_date = datetime.now(),
|
||||||
schedule_interval = "0 0 1 */3 *",
|
schedule_interval = timedelta(days=60),
|
||||||
catchup = False,
|
catchup = False,
|
||||||
tags = ["food-security", "bigquery", "kimball"],
|
tags = ["food-security", "bigquery", "kimball"],
|
||||||
) as dag:
|
) as dag:
|
||||||
@@ -102,47 +89,38 @@ with DAG(
|
|||||||
task_id = "verify_bigquery_connection",
|
task_id = "verify_bigquery_connection",
|
||||||
python_callable = run_verify_connection
|
python_callable = run_verify_connection
|
||||||
)
|
)
|
||||||
|
|
||||||
task_fao = PythonOperator(
|
task_fao = PythonOperator(
|
||||||
task_id = "load_fao_to_bronze",
|
task_id = "load_fao_to_bronze",
|
||||||
python_callable = run_load_fao
|
python_callable = run_load_fao
|
||||||
)
|
)
|
||||||
|
|
||||||
task_worldbank = PythonOperator(
|
task_worldbank = PythonOperator(
|
||||||
task_id = "load_worldbank_to_bronze",
|
task_id = "load_worldbank_to_bronze",
|
||||||
python_callable = run_load_worldbank
|
python_callable = run_load_worldbank
|
||||||
)
|
)
|
||||||
|
|
||||||
task_unicef = PythonOperator(
|
task_unicef = PythonOperator(
|
||||||
task_id = "load_unicef_to_bronze",
|
task_id = "load_unicef_to_bronze",
|
||||||
python_callable = run_load_unicef
|
python_callable = run_load_unicef
|
||||||
)
|
)
|
||||||
|
|
||||||
task_staging = PythonOperator(
|
task_staging = PythonOperator(
|
||||||
task_id = "staging_integration_to_silver",
|
task_id = "staging_integration_to_silver",
|
||||||
python_callable = run_staging_integration
|
python_callable = run_staging_integration
|
||||||
)
|
)
|
||||||
|
|
||||||
task_cleaned = PythonOperator(
|
task_cleaned = PythonOperator(
|
||||||
task_id = "cleaned_integration_to_silver",
|
task_id = "cleaned_integration_to_silver",
|
||||||
python_callable = run_cleaned_integration
|
python_callable = run_cleaned_integration
|
||||||
)
|
)
|
||||||
|
|
||||||
task_dimensional = PythonOperator(
|
task_dimensional = PythonOperator(
|
||||||
task_id = "dimensional_model_to_gold",
|
task_id = "dimensional_model_to_gold",
|
||||||
python_callable = run_dimensional_model
|
python_callable = run_dimensional_model
|
||||||
)
|
)
|
||||||
|
|
||||||
task_analytical = PythonOperator(
|
task_analytical = PythonOperator(
|
||||||
task_id = "analytical_layer_to_gold",
|
task_id = "analytical_layer_to_gold",
|
||||||
python_callable = run_analytical_layer
|
python_callable = run_analytical_layer
|
||||||
)
|
)
|
||||||
|
|
||||||
task_aggregation = PythonOperator(
|
task_aggregation = PythonOperator(
|
||||||
task_id = "aggregation_to_gold",
|
task_id = "aggregation_to_gold",
|
||||||
python_callable = run_aggregation
|
python_callable = run_aggregation
|
||||||
)
|
)
|
||||||
|
|
||||||
task_indicator_norm = PythonOperator(
|
task_indicator_norm = PythonOperator(
|
||||||
task_id = "indicator_norm_aggregation_to_gold",
|
task_id = "indicator_norm_aggregation_to_gold",
|
||||||
python_callable = run_indicator_norm_aggregation
|
python_callable = run_indicator_norm_aggregation
|
||||||
|
|||||||
@@ -102,10 +102,12 @@ PILLAR_NAME_ID_MAP: dict = {
|
|||||||
"Access" : "Akses",
|
"Access" : "Akses",
|
||||||
"Utilization" : "Pemanfaatan",
|
"Utilization" : "Pemanfaatan",
|
||||||
"Stability" : "Stabilitas",
|
"Stability" : "Stabilitas",
|
||||||
|
"Sustainability": "Keberlanjutan",
|
||||||
"availability" : "Ketersediaan",
|
"availability" : "Ketersediaan",
|
||||||
"access" : "Akses",
|
"access" : "Akses",
|
||||||
"utilization" : "Pemanfaatan",
|
"utilization" : "Pemanfaatan",
|
||||||
"stability" : "Stabilitas",
|
"stability" : "Stabilitas",
|
||||||
|
"sustainability": "Keberlanjutan",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mapping nama indikator (Inggris -> Indonesia)
|
# Mapping nama indikator (Inggris -> Indonesia)
|
||||||
|
|||||||
@@ -98,15 +98,18 @@ PILLAR_TRANSLATION_ID: dict = {
|
|||||||
"Access" : "Keterjangkauan",
|
"Access" : "Keterjangkauan",
|
||||||
"Utilization" : "Pemanfaatan",
|
"Utilization" : "Pemanfaatan",
|
||||||
"Stability" : "Stabilitas",
|
"Stability" : "Stabilitas",
|
||||||
|
"Sustainability" : "Keberlanjutan",
|
||||||
# Variasi penulisan yang mungkin muncul
|
# Variasi penulisan yang mungkin muncul
|
||||||
"availability" : "Ketersediaan",
|
"availability" : "Ketersediaan",
|
||||||
"access" : "Keterjangkauan",
|
"access" : "Keterjangkauan",
|
||||||
"utilization" : "Pemanfaatan",
|
"utilization" : "Pemanfaatan",
|
||||||
"stability" : "Stabilitas",
|
"stability" : "Stabilitas",
|
||||||
|
"sustainability" : "Keberlanjutan",
|
||||||
"Food Availability" : "Ketersediaan Pangan",
|
"Food Availability" : "Ketersediaan Pangan",
|
||||||
"Food Access" : "Keterjangkauan Pangan",
|
"Food Access" : "Keterjangkauan Pangan",
|
||||||
"Food Utilization" : "Pemanfaatan Pangan",
|
"Food Utilization" : "Pemanfaatan Pangan",
|
||||||
"Food Stability" : "Stabilitas Pangan",
|
"Food Stability" : "Stabilitas Pangan",
|
||||||
|
"Food Sustainability": "Keberlanjutan Pangan",
|
||||||
}
|
}
|
||||||
|
|
||||||
INDICATOR_TRANSLATION_ID: dict = {
|
INDICATOR_TRANSLATION_ID: dict = {
|
||||||
|
|||||||
@@ -46,15 +46,18 @@ PILLAR_TRANSLATION_ID: dict = {
|
|||||||
"Access" : "Keterjangkauan",
|
"Access" : "Keterjangkauan",
|
||||||
"Utilization" : "Pemanfaatan",
|
"Utilization" : "Pemanfaatan",
|
||||||
"Stability" : "Stabilitas",
|
"Stability" : "Stabilitas",
|
||||||
|
"Sustainability": "Keberlanjutan",
|
||||||
# Variasi penulisan yang mungkin muncul
|
# Variasi penulisan yang mungkin muncul
|
||||||
"availability" : "Ketersediaan",
|
"availability" : "Ketersediaan",
|
||||||
"access" : "Keterjangkauan",
|
"access" : "Keterjangkauan",
|
||||||
"utilization" : "Pemanfaatan",
|
"utilization" : "Pemanfaatan",
|
||||||
"stability" : "Stabilitas",
|
"stability" : "Stabilitas",
|
||||||
|
"sustainability": "Keberlanjutan",
|
||||||
"Food Availability" : "Ketersediaan Pangan",
|
"Food Availability" : "Ketersediaan Pangan",
|
||||||
"Food Access" : "Keterjangkauan Pangan",
|
"Food Access" : "Keterjangkauan Pangan",
|
||||||
"Food Utilization" : "Pemanfaatan Pangan",
|
"Food Utilization" : "Pemanfaatan Pangan",
|
||||||
"Food Stability" : "Stabilitas Pangan",
|
"Food Stability" : "Stabilitas Pangan",
|
||||||
|
"Food Sustainability": "Keberlanjutan Pangan",
|
||||||
}
|
}
|
||||||
|
|
||||||
INDICATOR_TRANSLATION_ID: dict = {
|
INDICATOR_TRANSLATION_ID: dict = {
|
||||||
|
|||||||
Reference in New Issue
Block a user