Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

TableValueType should accept is_ operator class

Open Beginner friendly
#13,651 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@nightcityblade is already working on this.

Since Oct 6, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
postgresql, python, sqlalchemy
Domain
databases

Research direction

Start by locating TableValueType and its declared operator classes, then check nearby tests for operator-class behavior. Reproduce the reported warning with the table_valued().is_not(None) example; done when is and is_not are accepted without the deprecation warning and the relevant tests pass.

Written by the indexing model from the issue text.

Description

postgresql sql use case

In 2.1 different kind of operators were added, to improve their organisation in various construct.
The TableValueType currently does not allow is, and it's warning.

This is mostly a postgresql element, and pg does have IS available for rows and it has a specific meaning.

For example this is a perfectly valid example that warns

import sqlalchemy as sa

t = sa.Table(
    "t",
    sa.MetaData(),
    sa.Column("id", sa.Integer),
    sa.Column("name", sa.String()),
)

s = sa.select(t).where(t.table_valued().is_(None))

e = sa.create_engine("postgresql://scott:tiger@localhost/test")
e.echo = True
with e.connect() as conn:
    t.metadata.create_all(conn)
    conn.execute(t.insert(), [{'id': 1, 'name': 2}, {'id': None, 'name': None}])
    result = conn.execute(s).all()
    print(result)

This prints [(null, null)] (usually it's used with is not)

we above example raises

SADeprecationWarning: Type object <class 'sqlalchemy.sql.sqltypes.TableValueType'> does not include operator 'is_not' in its operator classes. Using built-in operators (not including custom or overridden operators) outside of a type's stated operator classes is deprecated and will raise InvalidRequestError in a future release
s = sa.select(t).where(t.table_valued().is_not(None))

Dominant language
Python
Stars
12.2k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sqlalchemy/sqlalchemy

All issues in sqlalchemy/sqlalchemy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.