Skip to content

Commit 9dd5ec9

Browse files
committed
add test for column percentage
1 parent cd98e95 commit 9dd5ec9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pandas/tests/io/test_sql.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,6 @@ def test_escaped_table_name(self):
952952

953953
tm.assert_frame_equal(res, df)
954954

955-
956955
@pytest.mark.single
957956
@pytest.mark.skipif(not SQLALCHEMY_INSTALLED, reason="SQLAlchemy not installed")
958957
class TestSQLApi(SQLAlchemyMixIn, _TestSQLApi):
@@ -1118,6 +1117,15 @@ def test_query_by_select_obj(self):
11181117
all_names = set(iris_df["Name"])
11191118
assert all_names == {"Iris-setosa"}
11201119

1120+
def test_column_with_percentage(self):
1121+
# GH 37157
1122+
df = DataFrame({"A": [0, 1, 2], "%_variation": [3, 4, 5]})
1123+
df.to_sql("test_column_percentage", self.conn, index=False)
1124+
1125+
res = sql.read_sql_table("test_column_percentage", self.conn)
1126+
1127+
tm.assert_frame_equal(res, df)
1128+
11211129

11221130
class _EngineToConnMixin:
11231131
"""

0 commit comments

Comments
 (0)