Skip to content

Commit

Permalink
fixing for newer version of pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
glamp committed Jun 17, 2014
1 parent b0a7fab commit b7e5ef7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pandasql/sqldf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from sqlparse.tokens import Whitespace
import pandas as pd
import numpy as np
from pandas.io.sql import write_frame, frame_query
from pandas.io.sql import to_sql, read_sql
import hashlib
import os
import re
Expand Down Expand Up @@ -71,7 +71,7 @@ def _write_table(tablename, df, conn):
msg += "http://www.sqlite.org/lang_keywords.html"
raise Exception(msg)

write_frame(df, name=tablename, con=conn, flavor='sqlite')
to_sql(df, name=tablename, con=conn, flavor='sqlite')


def sqldf(q, env, inmemory=True):
Expand Down Expand Up @@ -124,7 +124,7 @@ def sqldf(q, env, inmemory=True):
_write_table(table, df, conn)

try:
result = frame_query(q, conn)
result = read_sql(q, conn)
except:
result = None
finally:
Expand Down

0 comments on commit b7e5ef7

Please sign in to comment.