Skip to content

Commit be758d7

Browse files
author
Jesse Whitehouse
committed
(5/x) Pandas requires sqlalchemy 1.4 to work. So we can skip this for earlier versions
Signed-off-by: Jesse Whitehouse <[email protected]>
1 parent 01ec014 commit be758d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/e2e/sqlalchemy/test_basic.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def test_connect_args(db_engine):
9898
assert expected in user_agent
9999

100100

101+
@pytest.mark.skipif(sqlalchemy_1_3(), reason="Pandas requires SQLAlchemy >= 1.4")
101102
def test_pandas_upload(db_engine, metadata_obj):
102103

103104
import pandas as pd
@@ -237,7 +238,11 @@ class SampleObject(base):
237238
SampleObject.name.in_(["Bim Adewunmi", "Miki Meek"])
238239
)
239240

240-
output = [i for i in session.scalars(stmt)]
241+
if sqlalchemy_1_3():
242+
output = [i for i in session.execute(stmt)]
243+
else:
244+
output = [i for i in session.scalars(stmt)]
245+
241246
assert len(output) == 2
242247

243248
base.metadata.drop_all()

0 commit comments

Comments
 (0)