surrealdb.py
surrealdb.py copied to clipboard
Draft: Fix return types of some `Surreal` methods
Change some return types from List[Dict, Any]
to Unions[Dict[str, Any], List[Dict, Any]]
, or the Optional[...], variant of that.
What is the motivation?
Fix the currently incomplete/wrong return type annotations of some Surreal
(WS/RPC client) methods.
Improving developer experience of users.
Type of Change
- [ ] 📚 Examples / docs / tutorials / dependencies update
- [X] 🔧 Bug fix (non-breaking change which fixes an issue)
- [ ] 🥂 Improvement (non-breaking change which improves an existing feature)
- [ ] 🚀 New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to change)
- [ ] 🔐 Security fix
What does this change do?
Changes the return type of some methods from List[Dict[str, Any]]
to
-
Union[Dict[str, Any], List[Dict[str, Any]]]
forcreate
,update
, andmerge
-
Optional[Union[Dict[str, Any], List[Dict[str, Any]]]]
forselect
anddelete
What is your testing strategy?
mypy
returned OK
pre-commit
returned OK
./scripts/run_tests.sh
returned OK
Is this related to any issues?
Yes: https://github.com/surrealdb/surrealdb.py/issues/97 This PR is regarding the first "1." propose solution in the above referenced issue.
Have you read the Contributing Guidelines?
- [X] I have read the Contributing Guidelines