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

Draft: Fix return types of some Surreal methods #98

Conversation

Wouterkoorn
Copy link

@Wouterkoorn Wouterkoorn commented Apr 1, 2024

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
  • 🔧 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]]] for create, update, and merge
  • Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] for select and delete

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: #97
This PR is regarding the first "1." propose solution in the above referenced issue.

Have you read the Contributing Guidelines?

Change some return types from `List[Dict, Any]` to `Unions[Dict[str, Any], List[Dict, Any]]`, or the Optional[...], variant of that.
@Wouterkoorn Wouterkoorn changed the title Fix return types of some Surreal methods Draft: Fix return types of some Surreal methods Apr 1, 2024
@Wouterkoorn Wouterkoorn marked this pull request as draft April 1, 2024 23:17
@maxwellflitton
Copy link
Contributor

@Wouterkoorn thanks for this PR, I will work on the conflicts and get this merged. Sorry for the late reply as I have been working on some other areas.

@tobiemh
Copy link
Member

tobiemh commented Nov 25, 2024

Closing this pull-request as the latest codebase has now been significantly updated, now making use of a native Python with binary communication with remote databases, and support for embedded database usage. The native Python library now has support for custom types, including datetimes, durations, decimals, geojson types, Record IDs, ranges, and tables 🎉.

@tobiemh tobiemh closed this Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants