Skip to content

Commit dfbf1c7

Browse files
committed
TST: pd.to_sql for dataframes with -np.inf (pandas-dev#34431)
1 parent 208a6ec commit dfbf1c7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/io/test_sql.py

+7
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,13 @@ class DummyException(Exception):
564564
res2 = self.pandasSQL.read_query("SELECT * FROM test_trans")
565565
assert len(res2) == 1
566566

567+
def _to_sql_with_negative_npinf(self):
568+
engine = sqlalchemy.create_engine("sqlite://", echo=False)
569+
570+
pd.DataFrame({"foo": [np.inf]}).to_sql("foobar1", engine)
571+
pd.DataFrame({"foo": [-np.inf]}).to_sql("foobar2", engine)
572+
pd.DataFrame({"foo": [-np.inf], "infe0": ["bar"]}).to_sql("foobar3", engine)
573+
567574

568575
# -----------------------------------------------------------------------------
569576
# -- Testing the public API

0 commit comments

Comments
 (0)