Skip to content

SQLAlchemy compliance suite: audit skipped tests and re-enable supportable ones #736

Description

@laughingman7743

Summary

The SQLAlchemy compliance suite (tests/sqlalchemy/test_suite.py) deletes test classes and skips individual methods.
pyathena/sqlalchemy/requirements.py also declares requirements as unsupported.
Some exclusions are genuine Athena limitations, while others can be implemented or narrowed by the dialect.

This umbrella issue tracks the audit.
Each remaining workstream is a sub-issue intended for a separate implementation session, worktree, and draft pull request.

Important context: the compliance suite runs against Iceberg tables because tests/sqlalchemy/conftest.py appends tblproperties='table_type'='ICEBERG' to the dburi.
Iceberg tables support row-level UPDATE, DELETE, and MERGE, so Iceberg DML is in scope for the suite.

A. Likely supportable

B. Needs verification against Athena engine v3

C. Genuinely unsupported by Athena

No implementation is planned for the exclusions below unless Athena adds the required capability.

  • PK, FK, unique, and index constraints and their reflection: foreign_keys, on_update_cascade, self_referential_foreign_keys, foreign_key_ddl, primary_key_constraint_reflection, foreign_key_constraint_reflection, index_reflection, indexes_with_ascdesc, reflect_indexes_with_ascdesc, unique_constraint_reflection, duplicate_key_raises_integrity_error, recursive_fk_cascade, CompositeKeyReflectionTest, JoinTest, and HasIndexTest.
  • Identity and autoincrement: autoincrement_insert, IdentityAutoincrementTest, and InsertBehaviorTest.test_insert_from_select_autoinc(_no_rows).
  • Types Athena lacks: TimeTest, TimeMicrosecondsTest, UuidTest, and uuid_data_type.
  • Syntax Athena lacks: DistinctOnTest and expression-based LIMIT or OFFSET cases.
  • Temporary tables: temporary_tables and temp_table_reflection.

Test constraints

  • Run only the affected test nodes locally.
  • Run Athena tests with -n 1 because the development account has limited query concurrency.
  • Prefer compile-only or unit tests when they prove the behavior without Athena.
  • Leave complete SQLAlchemy and Python-version matrices to CI.

References

  • Test suite exclusions: tests/sqlalchemy/test_suite.py
  • Requirements: pyathena/sqlalchemy/requirements.py
  • Dialect: pyathena/sqlalchemy/base.py and pyathena/sqlalchemy/compiler.py
  • Suite configuration: setup.cfg and tests/sqlalchemy/conftest.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions