Skip to content

fix Infer SQLAlchemy mapped_column type #1600 - #5451

Closed
asukaminato0721 wants to merge 2 commits into
meta:mainfrom
asukaminato0721:1600
Closed

asukaminato0721 wants to merge 2 commits into
meta:mainfrom
asukaminato0721:1600

Conversation

@asukaminato0721

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1600

continue #1908

  • I am a human, and I fully understand the code I am submitting.

Test Plan

add test

Recognize mapped_column calls and refine MappedColumn value types from SQLAlchemy type engines. Preserve descriptor identity, apply generic substitutions, infer enum classes, and respect explicit nullability.
@meta-codesync

meta-codesync Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D128344019. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

Copy link
Copy Markdown

Diff from mypy_primer, showing the effect of this PR on open source code:

============================================================
SUMMARY
============================================================
Total: +1 new errors, -5 fixed errors
By preset: +0/-0 (default), +0/-0 (strict)

Projects with changes (1):
  freqtrade: +1 -5
============================================================

FULL DIFF DETAILS
------------------------------------------------------------

freqtrade (https://github.com/freqtrade/freqtrade)
- ERROR freqtrade/persistence/custom_data.py:58:35-37: The type of attribute `id` is an explicit `Any` [explicit-any-use]
- ERROR freqtrade/persistence/custom_data.py:59:55-66: The type of attribute `ft_trade_id` is an explicit `Any` [explicit-any-use]
- ERROR freqtrade/persistence/custom_data.py:127:32-43: The type of attribute `ft_trade_id` is an explicit `Any` [explicit-any-use]
- ERROR freqtrade/persistence/custom_data.py:148:32-43: The type of attribute `ft_trade_id` is an explicit `Any` [explicit-any-use]
- ERROR freqtrade/persistence/db_migration.py:64:26-81: The type of `max_custom_data_id` is an explicit `Any` [explicit-any-use]
+ ERROR freqtrade/persistence/db_migration.py:73:25-43: Implicit conversion of `int | None` to `bool` is not allowed [implicit-bool]

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync

meta-codesync Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 8615bc7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infer SQLAlchemy mapped_column type

3 participants