Skip to content

COMPAT/TST: warnings for sql installs on python 3.5 #11112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jreback opened this issue Sep 15, 2015 · 2 comments
Closed

COMPAT/TST: warnings for sql installs on python 3.5 #11112

jreback opened this issue Sep 15, 2015 · 2 comments
Labels
Compat pandas objects compatability with Numpy or Python functions IO SQL to_sql, read_sql, read_sql_query Testing pandas testing functions or related to the test suite

Comments

@jreback
Copy link
Contributor

jreback commented Sep 15, 2015

These are actually from the current version of nose (e.g. it has a deprecation warning in inspect).

currently I have sqlalchemy and friends not installing on 3.5 (though they can be), they are commented out in requirements-3.5.txt

So can do things like this (e.g. I did this in test_pytables.py), until a new nose comes out.
e.g. see #11114

expected_warning = Warning if compat.PY35 else PerformanceWarning
with tm.assert_produces_warning(expected_warning=expected_warning, check_stacklevel=False):
    ....
(py3.5)bash-3.2$ nosetests  pandas/io/tests/test_sql.py 
SSS.........................................................................S...........F.F........F..........F...........F.F........F..........F..F...................................F................................S.....................................................S/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2183: FutureWarning: write_frame is deprecated, use to_sql
  sql.write_frame(frame, name='test_table', con=self.conn)
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2184: FutureWarning: read_frame is deprecated, use read_sql
  result = sql.read_frame("select * from test_table", self.conn)
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2195: FutureWarning: write_frame is deprecated, use to_sql
  sql.write_frame(frame2, name='test_table2', con=self.conn)
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2197: FutureWarning: read_frame is deprecated, use read_sql
  index_col='Idx')
./Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2110: FutureWarning: read_frame is deprecated, use read_sql
  result = sql.read_frame("select * from test", self.conn)
./Users/jreback/miniconda/envs/py3.5/pandas/pandas/util/testing.py:1872: FutureWarning: tquery is deprecated, and will be removed in future versions. You can use ``execute(...).fetchall()`` instead.
  _callable(*args, **kwargs)
../Users/jreback/miniconda/envs/py3.5/pandas/pandas/util/testing.py:1872: FutureWarning: write_frame is deprecated, use to_sql
  _callable(*args, **kwargs)
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2285: FutureWarning: write_frame is deprecated, use to_sql
  flavor='sqlite', if_exists='fail')
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2296: FutureWarning: write_frame is deprecated, use to_sql
  flavor='sqlite', if_exists='replace')
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2297: FutureWarning: tquery is deprecated, and will be removed in future versions. You can use ``execute(...).fetchall()`` instead.
  self.assertEqual(sql.tquery(sql_select, con=self.conn),
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2300: FutureWarning: write_frame is deprecated, use to_sql
  flavor='sqlite', if_exists='replace')
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2301: FutureWarning: tquery is deprecated, and will be removed in future versions. You can use ``execute(...).fetchall()`` instead.
  self.assertEqual(sql.tquery(sql_select, con=self.conn),
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2307: FutureWarning: write_frame is deprecated, use to_sql
  flavor='sqlite', if_exists='fail')
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2308: FutureWarning: tquery is deprecated, and will be removed in future versions. You can use ``execute(...).fetchall()`` instead.
  self.assertEqual(sql.tquery(sql_select, con=self.conn),
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2311: FutureWarning: write_frame is deprecated, use to_sql
  flavor='sqlite', if_exists='append')
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2312: FutureWarning: tquery is deprecated, and will be removed in future versions. You can use ``execute(...).fetchall()`` instead.
  self.assertEqual(sql.tquery(sql_select, con=self.conn),
./Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2243: FutureWarning: write_frame is deprecated, use to_sql
  sql.write_frame(df, con = self.conn, name = 'testkeywords')
../Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2250: FutureWarning: write_frame is deprecated, use to_sql
  sql.write_frame(mono_df, con = self.conn, name = 'mono_df')
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2257: FutureWarning: read_frame is deprecated, use read_sql
  result = sql.read_frame("select * from mono_df",con_x)
../Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2205: FutureWarning: write_frame is deprecated, use to_sql
  sql.write_frame(frame, name='test_table', con=self.conn)
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2206: FutureWarning: tquery is deprecated, and will be removed in future versions. You can use ``execute(...).fetchall()`` instead.
  result = sql.tquery("select A from test_table", self.conn)
./Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2223: FutureWarning: write_frame is deprecated, use to_sql
  sql.write_frame(frame, name='test_table', con=self.conn)
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2225: FutureWarning: uquery is deprecated, and will be removed in future versions. You can use ``execute(...).rowcount`` instead.
  self.assertEqual(sql.uquery(stmt, con=self.conn), 1)
./Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2091: FutureWarning: tquery is deprecated, and will be removed in future versions. You can use ``execute(...).fetchall()`` instead.
  sql.tquery(fmt_sql, cur=cur)
/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py:2095: FutureWarning: read_frame is deprecated, use read_sql
  result = sql.read_frame("select * from test", con=self.conn)
======================================================================
FAIL: test_legacy_write_frame (test_sql.TestSQLApi)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py", line 587, in test_legacy_write_frame
    flavor='sqlite')
  File "/Users/jreback/miniconda/envs/py3.5/lib/python3.5/contextlib.py", line 66, in __exit__
    next(self.gen)
  File "/Users/jreback/miniconda/envs/py3.5/pandas/pandas/util/testing.py", line 2021, in assert_produces_warning
    % extra_warnings)
AssertionError: Caused unexpected warning(s): ['PendingDeprecationWarning'].

======================================================================
FAIL: test_not_reflect_all_tables (test_sql.TestSQLApi)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py", line 906, in test_not_reflect_all_tables
    self.assertEqual(len(w), 0, "Warning triggered for other table")
AssertionError: 2 != 0 : Warning triggered for other table

======================================================================
FAIL: test_timedelta (test_sql.TestSQLApi)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py", line 671, in test_timedelta
    df.to_sql('test_timedelta', self.conn)
  File "/Users/jreback/miniconda/envs/py3.5/lib/python3.5/contextlib.py", line 66, in __exit__
    next(self.gen)
  File "/Users/jreback/miniconda/envs/py3.5/pandas/pandas/util/testing.py", line 2021, in assert_produces_warning
    % extra_warnings)
AssertionError: Caused unexpected warning(s): ['PendingDeprecationWarning'].

======================================================================
FAIL: test_warning_case_insensitive_table_name (test_sql.TestSQLApi)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jreback/miniconda/envs/py3.5/pandas/pandas/io/tests/test_sql.py", line 919, in test_warning_case_insensitive_table_name
    self.assertEqual(len(w), 0, "Warning triggered for writing a table")
AssertionError: 1 != 0 : Warning triggered for writing a table

.....
@jreback jreback added Testing pandas testing functions or related to the test suite IO SQL to_sql, read_sql, read_sql_query Compat pandas objects compatability with Numpy or Python functions Python 3.5 labels Sep 15, 2015
@jreback jreback added this to the 0.17.1 milestone Sep 15, 2015
@jreback jreback modified the milestones: Next Major Release, 0.17.1 Nov 13, 2015
@kokes
Copy link
Contributor

kokes commented Dec 16, 2018

@jreback I guess this is no longer an issue, even the testing framework has changed in the meantime :)

@mroeschke
Copy link
Member

Agreed. This is probably not an issue anymore since we are using pytest. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions IO SQL to_sql, read_sql, read_sql_query Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

3 participants