dropbox / dropbox/sqlalchemy-stubs
Infer non-optional types for some type decorators
Open
bug
priority-normal
topic-plugins
- Dominant language
- Python
- Stars
- 583
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
Imagine a type decorator:
```python
class FancyDict(TypeDecorator[Dict[str, Any]]):
impl = Unicode
def process_bind_param(self, value, dialect):
...
def process_result_value(self, value, dialect) -> Dict[str, Any]: # note non-optional return
if value:
return json.loads(value)
return {}
```
For such types a column should be considered non-optional even if it is nullable. This looks like a work for plugin.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.