Skip to content
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

type wrongly inferenced when using sqlalchemy.asc #181

Open
taraskuzyk opened this issue Oct 8, 2021 · 1 comment
Open

type wrongly inferenced when using sqlalchemy.asc #181

taraskuzyk opened this issue Oct 8, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@taraskuzyk
Copy link

Describe the bug
type inferenced is int

Expected behavior
type inferenced should be Uninon of int and Column
image

To Reproduce
session.query(Object).order_by(asc(Object.field)) where field is of type Column(Integer)

Please do not use Flask-SQLAlchemy or any other third-party extensions or dependencies in test cases. The test case must illustrate the problem without using any third party SQLAlchemy extensions. Otherwise, please report the bug to those projects first.

# Insert code here

Error

# Copy error here. Please include the full stack trace.

Versions.

  • OS: Windows
  • Python: 3.9
  • SQLAlchemy: 1.4
  • mypy: none
  • SQLAlchemy2-stubs: latest

Additional context
using PyCharm 2021

Have a nice day!

@taraskuzyk taraskuzyk added the requires triage New issue that requires categorization label Oct 8, 2021
@CaselIT
Copy link
Member

CaselIT commented Oct 8, 2021

Hi,

What is the model definition?

At the moment I think this need the mypy pluging to work properly, I'm not sure what pycharm uses to provide inference.

We are experimenting with some changes that hopefully will improve things.

Thanks for reporting

@CaselIT CaselIT added bug Something isn't working and removed requires triage New issue that requires categorization labels Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants