DAG: SierraGorda_RingsDesviation Functions that relate hole information between the Opit system and drilling rigs to SierraGorda

schedule: 30 15 * * *


SierraGorda_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
49
50
51
52
53
54
55
# 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 datetime 
from datetime import timedelta

# Dependencias propias
from utils import desviation_function as desvf
from utils.settings import FECHA_ACTUAL

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

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

"""
    Generación de desviaciones pozos
"""
# RingsDesviationOpitSG_task1 = PythonOperator(
#     task_id = 'Desviacion_PozosOpit_SG',
#     python_callable = desvf.cruce_desviaciones_pozos_mes,
#     op_kwargs = {'p_mes_int':int(FECHA_ACTUAL.replace('-','')[:6])
#                 },
#     dag = sierragorda_desviation_dag,
# )

RingsDesviationOpitSG_task1 = PythonOperator(
    task_id = 'Desviacion_PozosOpit_SG',
    python_callable = desvf.generar_desvcollar_mes_gralsierra_gorda,
    op_kwargs = {'p_mes_int':int(FECHA_ACTUAL.replace('-','')[:6])
                },
    dag = sierragorda_desviation_dag,
)

# Define task secuence 
RingsDesviationOpitSG_task1