8000 SQLAlchemy: Annotate text() by srittau · Pull Request #9498 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

SQLAlchemy: Annotate text() #9498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 11, 2023
Merged

Conversation

srittau
Copy link
Collaborator
@srittau srittau commented Jan 11, 2023

No description provided.

@srittau
Copy link
Collaborator Author
srittau commented Jan 11, 2023

Depends on #9490.

@github-actions

This comment has been minimized.

@srittau
Copy link
Collaborator Author
srittau commented Jan 11, 2023

Concerning the primer output:

  • pandas does stmt = text(stmt), which reassigns a different type, so the new warning is genuine.
  • The other new warnings are genuine, although technically unrelated to this PR. But I will fix them.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

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

pandas (https://github.com/pandas-dev/pandas)
+ pandas/tests/io/test_sql.py:274: error: Incompatible types in assignment (expression has type "TextClause", variable has type "str")  [assignment]

Copy link
Member
@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Wow, the _generative decorator seems almost like it's deliberately designed to confuse stubgen

@AlexWaygood AlexWaygood merged commit b8f337a into python:main Jan 11, 2023
@srittau srittau deleted the sqlalchemy-text branch January 11, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development
395C

Successfully merging this pull request may close these issues.

2 participants
0