Skip to content

Commit

Permalink
Merge pull request EvgSkv#6 from EvgSkv/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
EvgSkv authored Oct 16, 2020
2 parents c4ae569 + 064f26a commit 08f540a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion colab_logica.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ def RunSQL(sql, engine):
return client.query(sql).to_dataframe()
elif engine == 'psql':
return pandas.read_sql(sql, DB_CONNECTION)
elif engine == 'sqlite':
statements = parse.SplitRaw(sql, ';')
for s in statements[:-2]:
cursor = DB_CONNECTION.execute(s)
return pandas.read_sql(statements[-2], DB_CONNECTION)
else:
raise Exception('Logica colab only supports BigQuery and PostgreSQL '
raise Exception('Logica only supports BigQuery, PostgreSQL and SQLite '
'for now.')


Expand Down

0 comments on commit 08f540a

Please sign in to comment.