This file contains 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
from io import StringIO | |
import sys | |
from typing import Dict, Optional | |
from langchain.agents import load_tools | |
from langchain.agents import initialize_agent | |
from langchain.agents.tools import Tool | |
from langchain.llms import OpenAI | |
This file contains 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
# -*- coding: utf-8 -*- | |
from airflow.operators.http_operator import SimpleHttpOperator | |
from airflow.operators.postgres_operator import PostgresOperator | |
from airflow.operators.subdag_operator import SubDagOperator | |
from airflow.operators.sensors import SqlSensor | |
from airflow.hooks.postgres_hook import PostgresHook | |
from airflow.operators.python_operator import PythonOperator | |
from airflow.models import Variable, DAG |
This file contains 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
# -*- coding: utf-8 -*- | |
from airflow.operators.http_operator import SimpleHttpOperator | |
from airflow.operators.postgres_operator import PostgresOperator | |
from airflow.operators.subdag_operator import SubDagOperator | |
from airflow.operators.sensors import SqlSensor | |
from airflow.hooks.postgres_hook import PostgresHook | |
from airflow.operators.python_operator import PythonOperator | |
from airflow.models import Variable, DAG |
This file contains 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 gzip | |
from functools import wraps | |
import boto3 | |
from sqlalchemy import MetaData | |
from pandas import DataFrame | |
from pandas.io.sql import SQLTable, pandasSQL_builder | |
import psycopg2 | |
import codecs | |
import cStringIO | |
from io import BytesIO |
This file contains 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
# this script has been tested and worked in a freshly installed Ubuntu 16.04 and 16.10 | |
# it assumes that you are running airflow in a private netowrk and no need to be worry about outside access | |
# if that's not the case, the lines for PostgreSQL and Redis in this script need to be updated accordingly | |
# run as root | |
sudo su | |
# initial system updates and installs | |
apt-get update && apt-get upgrade -y && apt-get autoremove && apt-get autoclean | |
apt-get -y install build-essential binutils gcc make git htop nethogs tmux |