This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import argparse | |
| def translate_to_sql(source_file, output_file, table, skip_header=False, columns=[]): | |
| if skip_header and len(columns) == 0: | |
| raise TypeError( | |
| "É preciso informar as colunas quando o cabeçalho do CSV é evitado" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import html | |
| _charref = re.compile(r'&(#[0-9]+;?' | |
| r'|#[xX][0-9a-fA-F]+;?' | |
| r'|[^\t\n\f <&#;]{1,32};?)') | |
| def html_safe_decode(string, forbidden=["<", ">", "&"]): | |
| """ | |
| >>> "26. Cohen J. The Earth is Round (p.05>Am Psychol 1994; 49: 997-1003" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import json | |
| import logging | |
| import argparse | |
| logging.basicConfig(format="%(asctime)s - %(message)s", level=logging.DEBUG) | |
| logger = logging.getLogger(__name__) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RemoveReferencesFromBodyPipe(CustomPipe): | |
| def transform(self, data): | |
| raw, xml = data | |
| if len(self.super_obj.ref_items) > 0: | |
| reference_header, references = self._find_references_to_delete(xml) | |
| if len(self.super_obj.ref_items) == len(references): | |
| self._mark_references_to_be_deleted(references + [reference_header]) | |
| else: | |
| logger.info("RemoveReferencesFromBodyPipe: FALHOU") | |
| return data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main exposing (Model, Msg) | |
| import Browser | |
| import Browser.Navigation as Nav | |
| import Html exposing (..) | |
| import Html.Attributes exposing (..) | |
| import Url | |
| import Url.Parser as Parser exposing (Parser, oneOf, s, top) | |
| -- import Types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| S1517-106X2013000200012 | |
| S1517-106X2012000100007 | |
| S1414-753X2003000300008 | |
| S1414-753X2001000800007 | |
| S1414-753X1999000200004 | |
| S1414-753X2013000400006 | |
| S1414-753X2009000100004 | |
| S1414-753X2014000300005 | |
| S1414-753X2014000300013 | |
| S1414-753X2013000100006 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create schema api; | |
| CREATE TYPE api.EVENT_STATE_ENUM AS ENUM ('success', 'fail'); | |
| -- document table | |
| CREATE TABLE api.documents( | |
| id CHAR(23) PRIMARY KEY | |
| ); | |
| -- validations events |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import os | |
| from airflow import DAG | |
| from airflow.models import Variable | |
| from airflow.operators.python_operator import PythonOperator | |
| from datetime import datetime | |
| from airflow.utils.state import State | |
| from airflow.models import DagRun, clear_task_instances | |
| from airflow.utils import timezone | |
| from airflow import settings, models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import airflow | |
| from airflow import DAG | |
| from airflow.operators.dagrun_operator import TriggerDagRunOperator | |
| def trigger_payload(context, dag_run_obj): | |
| dag_run_obj.payload = {"issues": ["issue-1"]} | |
| return dag_run_obj | |
| # Define the DAG | |
| dag = DAG( |