Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

TableValueType should accept is_ operator class

未关闭 适合新手
#13,651 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@nightcityblade 已经在做这个了。

开始于 2026年10月6日。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
postgresql, python, sqlalchemy
领域
databases

调研方向

首先找到 TableValueType 及其声明的运算符类,然后查看附近关于运算符类行为的测试。使用 table_valued().is_not(None) 示例重现报告的警告;当 is 和 is_not 在没有弃用警告的情况下被接受,且相关测试通过时,即为完成。

由索引模型根据 Issue 内容生成。

描述

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))

主要语言
Python
星标
12.2k
派生
1.8k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sqlalchemy/sqlalchemy 的其他 Issue

查看 sqlalchemy/sqlalchemy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。