Title
#beginners-need-help
desrame

desrame

03/05/2022, 3:28 AM
# catalog.yml definition
lstm_base:
    type: pandas.SQLTableDataSet
    table_name: sometable
    credentials: sql1

# credentials.yml in local
sql1:
    con: mssql+pyodbc:///?odbc_connect=DRIVER={ODBC+Driver+17+for+SQL+Server};SERVER=someserver;DATABASE=somedatabase;UID=someuser;PWD=somepwd

# .py version working in .py script
conn = \
    'DRIVER={ODBC Driver 17 for SQL Server};SERVER=someserver;DATABASE=somedatabase;UID=someuser;PWD=somepassword'
quoted = quote_plus(conn)
new_con = 'mssql+pyodbc:///?odbc_connect={}'.format(quoted)
engine = create_engine(new_con, fast_executemany=True, connect_args={'timeout': 100})