Repository navigation
Review the PyHive-derived DB API tests repeated for each cursor class #1260
Description
Summary
Part of #1239. Review the tests that follow PyHive's DB API and SQLAlchemy test cases and that are repeated for each cursor class, against "Choose what to test" in docs/testing.md. The audit in #1239 kept them as original tests. Update NOTICE, which still names a PyHive-derived test that #1251 removed.
Facts (origin/master 193d23b, 2026-10-18)
-
NOTICEsays that PyAthena's tests follow PyHive'spyhive/tests/dbapi_test_case.pyandpyhive/tests/sqlalchemy_test_case.py, compared at PyHive ae3c9a9645ebd3dc962060d498df73e96498d615. At that revision,dbapi_test_case.pydefines 21 test names andsqlalchemy_test_case.pydefines 11. -
In
tests/pyathena/, 112 test functions in 17 files have one of the 21 DB API names, and 11 in 3 files have one of the SQLAlchemy names.Test Copies test_fetchone,test_fetchmany,test_fetchall18 each test_open_close,test_arraysize11 each test_iterator9 test_executemany7 test_description_initial,test_bad_query6 each The fetch tests are repeated in the sync, async, and aio test files of the default, pandas, Arrow, Polars, and S3FS cursors.
-
Several open PRs remove some of these copies, mostly the aio ones: Remove and rewrite unnecessary Polars, Arrow, and S3FS cursor tests #1252 (Remove and rewrite unnecessary tests in the Polars, Arrow, and S3FS cursor tests #1246), Remove and rewrite unnecessary pandas cursor tests #1256 (Remove, merge, and trim unnecessary tests in the pandas tests #1244), and Remove and rewrite unnecessary aio and Spark cursor tests #1258 (Remove, merge, and rewrite duplicate tests in the asyncio and Spark tests #1245).
-
NOTICE(lines 35–36) says thattests/pyathena/aio/sqlalchemy/test_base.pyportstest_unicodeto the asynchronous dialect. Remove and rewrite unnecessary SQLAlchemy dialect tests #1251 removed that test, because the syncTestSQLAlchemyAthena::test_unicodecovers the shared bind formatting.
Proposed change
- Update
NOTICEfor the tests that remain at the time of the change. This includes the removed aiotest_unicode, and any PyHive-derived test that item 2 removes or moves. - For each copied test, name the code path it exercises: the result set class and its fetch implementation, the read path (UNLOAD or CSV), and the sync, async, or aio cursor. Keep one test per distinct path, and remove or merge copies that run through the same code with the same kind of evidence.
- Keep the queries that the remaining tests run to what their contracts need.
Order
After #1252, #1253, #1256, and #1258 merge. They change the same files, so this sub-issue starts from the tests they leave. Item 1 can land first.
Activity
Remove PyHive-derived fetch tests repeated on the same code path (GH-…
Drop the removed aio test_unicode from NOTICE (GH-1260)
Remove PyHive-derived fetch tests repeated on the same code path (GH-…