sqlalchemy2-stubs
sqlalchemy2-stubs copied to clipboard
Using compiles leads to untyped decorator
trafficstars
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
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()'