@@ -200,7 +200,7 @@ def tquery(sql, con=None, cur=None, retry=True):
200
200
warnings .warn (
201
201
"tquery is deprecated, and will be removed in future versions. "
202
202
"You can use ``execute(...).fetchall()`` instead." ,
203
- FutureWarning )
203
+ FutureWarning , stacklevel = 2 )
204
204
205
205
cur = execute (sql , con , cur = cur )
206
206
result = _safe_fetch (cur )
@@ -255,7 +255,7 @@ def uquery(sql, con=None, cur=None, retry=True, params=None):
255
255
warnings .warn (
256
256
"uquery is deprecated, and will be removed in future versions. "
257
257
"You can use ``execute(...).rowcount`` instead." ,
258
- FutureWarning )
258
+ FutureWarning , stacklevel = 2 )
259
259
260
260
cur = execute (sql , con , cur = cur , params = params )
261
261
@@ -618,7 +618,7 @@ def pandasSQL_builder(con, flavor=None, schema=None, meta=None,
618
618
return SQLDatabase (con , schema = schema , meta = meta )
619
619
else :
620
620
if flavor == 'mysql' :
621
- warnings .warn (_MYSQL_WARNING , FutureWarning )
621
+ warnings .warn (_MYSQL_WARNING , FutureWarning , stacklevel = 2 )
622
622
return SQLiteDatabase (con , flavor , is_cursor = is_cursor )
623
623
624
624
@@ -1672,15 +1672,17 @@ def get_schema(frame, name, flavor='sqlite', keys=None, con=None, dtype=None):
1672
1672
def read_frame (* args , ** kwargs ):
1673
1673
"""DEPRECATED - use read_sql
1674
1674
"""
1675
- warnings .warn ("read_frame is deprecated, use read_sql" , FutureWarning )
1675
+ warnings .warn ("read_frame is deprecated, use read_sql" , FutureWarning ,
1676
+ stacklevel = 2 )
1676
1677
return read_sql (* args , ** kwargs )
1677
1678
1678
1679
1679
1680
@Appender (read_sql .__doc__ , join = '\n ' )
1680
1681
def frame_query (* args , ** kwargs ):
1681
1682
"""DEPRECATED - use read_sql
1682
1683
"""
1683
- warnings .warn ("frame_query is deprecated, use read_sql" , FutureWarning )
1684
+ warnings .warn ("frame_query is deprecated, use read_sql" , FutureWarning ,
1685
+ stacklevel = 2 )
1684
1686
return read_sql (* args , ** kwargs )
1685
1687
1686
1688
@@ -1718,7 +1720,8 @@ def write_frame(frame, name, con, flavor='sqlite', if_exists='fail', **kwargs):
1718
1720
pandas.DataFrame.to_sql
1719
1721
1720
1722
"""
1721
- warnings .warn ("write_frame is deprecated, use to_sql" , FutureWarning )
1723
+ warnings .warn ("write_frame is deprecated, use to_sql" , FutureWarning ,
1724
+ stacklevel = 2 )
1722
1725
1723
1726
# for backwards compatibility, set index=False when not specified
1724
1727
index = kwargs .pop ('index' , False )
0 commit comments