DAG: Collahuasi_RingsDesviation Functions that relate hole information between the Opit system and drilling rigs to Collahuasi

schedule: 30 15 * * *


Collahuasi_RingsDesviation

Toggle wrap
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Airflow dependencies
from asyncio import Task
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.utils.dates import days_ago
from airflow.models import Variable
from airflow.operators.dagrun_operator import TriggerDagRunOperator

# Python dependencies
import sys
import os

from datetime import timedelta
from datetime import datetime 
from datetime import timedelta

# Dependencias propias
from utils import desviation_function as desvf
from utils.settings import RAW_CONTAINER, CLEAN_CONTAINER, PROCESS_CONTAINER, FECHA_ACTUAL

# Default arguments
default_args = {
    'owner': 'carlos',
    'start_date': datetime(2023, 12, 6, 0, 0, 0)
}

# Instanciate the DAG object
collahuasi_desviation_dag = DAG(
    'Collahuasi_RingsDesviation',
    default_args=default_args,
    description='Functions that relate hole information between the Opit system and drilling rigs to Collahuasi',
    schedule_interval='30 15 * * *', # Hora local 9:30 y 21:30
    catchup=False,
    is_paused_upon_creation=False
)

"""
    Tareas de cruce entre Perforaciones y Opit
"""
brightboard_perf_task1 = PythonOperator(
    task_id = 'Desviacion_PozosOpit_Collahuasi',
    python_callable = desvf.generar_desvcollar_mes_gralcollahuasi,
    op_kwargs = {'p_mes_int':int(FECHA_ACTUAL.replace('-','')[:6])},
    dag = collahuasi_desviation_dag,
)

# Define task secuence 
brightboard_perf_task1