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

Using compiles leads to untyped decorator #239

Open
kasium opened this issue Oct 18, 2022 · 1 comment
Open

Using compiles leads to untyped decorator #239

kasium opened this issue Oct 18, 2022 · 1 comment
Labels
bug Something isn't working missing type something is missing from the types

Comments

@kasium
Copy link
Contributor

kasium commented Oct 18, 2022

Describe the bug
The compile decorator is not fully typed. Therefore mypy complains when using it

Expected behavior
Mypy doesn't complain

To Reproduce
Use compile as a decorator

Error

error: Untyped decorator makes function "foo" untyped  [misc]

Versions.

  • OS: Linux
  • Python: 3.7.1
  • SQLAlchemy: 1.4.41
  • mypy: 0.982
  • SQLAlchemy2-stubs: 0.0.2a29

I'm happy to give a PR a try

@kasium kasium added the requires triage New issue that requires categorization label Oct 18, 2022
@CaselIT CaselIT added bug Something isn't working missing type something is missing from the types and removed requires triage New issue that requires categorization labels Oct 18, 2022
@verhovensky
Copy link

verhovensky commented Feb 15, 2024

Facing same issue


@compiles(Utcnow, 'postgresql')
def pg_utcnow(element, compiler, **kw):
    return "TIMEZONE('utc', CURRENT_TIMESTAMP)"


@compiles(Utcnow, 'mssql')
def ms_utcnow(element, compiler, **kw):
    return 'GETUTCDATE()'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working missing type something is missing from the types
Projects
None yet
Development

No branches or pull requests

3 participants