Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 time | |
from datetime import datetime, timedelta | |
from airflow import DAG | |
from airflow.operators.python_operator import PythonOperator | |
default_args = { | |
'owner': 'Meng Lee', | |
'start_date': datetime(2100, 1, 1, 0, 0), | |
'schedule_interval': '@daily', | |
'retries': 2, |
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 time | |
from datetime import datetime, timedelta | |
from airflow import DAG | |
from airflow.operators.python_operator import PythonOperator, BranchPythonOperator | |
from airflow.operators.dummy_operator import DummyOperator | |
from airflow.operators.slack_operator import SlackAPIPostOperator | |
default_args = { | |
'owner': 'Meng Lee', | |
'start_date': datetime(2100, 1, 1, 0, 0), |
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 time | |
import json | |
import logging | |
from datetime import datetime, timedelta | |
from selenium import webdriver | |
from airflow import DAG | |
from airflow.operators.python_operator import PythonOperator, BranchPythonOperator | |
from airflow.operators.dummy_operator import DummyOperator | |
from airflow.operators.slack_operator import SlackAPIPostOperator |
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
#!/usr/bin/env python3 | |
# coding: utf-8 | |
""" | |
Author : noklam | |
Created Time : 2019-11-09 12:30:04 | |
Base on: https://gist.github.com/weaming/32b7b62956b304ff66fbae396ca9c86b | |
Prerequisite: | |
python3 -m pip install cson arrow | |
""" | |
import json |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# # Using pandas merge_as_of (similar to a merge join) to do inexact join (join the nearest key instead) | |
import pandas as pd | |
# %% | |
table_a = pd.DataFrame([('2020-01-01'), ('2020-01-03'), ('2020-01-06')], | |
columns=['PK']) | |
table_b = pd.DataFrame([('2020-01-01', 'A'), ('2020-01-02', 'A'), | |
('2020-01-04', 'B'), ('2020-01-05', 'B')], | |
columns=['FK', 'Category']) | |
# %% |