Howdy,
Trying a simple ETL from Oracle to SQL Server
def sales_task(**kwargs):
mssql = mssql_hook.MsSqlHook()
oracle = oracle_hook.OracleHook()
df = oracle.get_pandas_df(sales_qry)
mssql.insert_rows('SALES',???)
But I'm sure what I should have instead of ???. I've tried list(df.itertuples()) and the same with iterrows(). How do you guys do writes using hooks?
I've tried using get_conn() as such but I appear to get errors relating to mssql and pandas (apparently its advised to not use pyodbc with mssql and instead use sql server for pandas > 0.15)
The only way I've gotten this to do is using pandas' to_sql with an inline SQL Alchemy engine. If there is a way to create a SQLAlchemy engine from a Hook I could use that.
I'm using Python 2.7 and Pandas 0.15.2 for what its worth.
Cheers,
Jack