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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Fix return types of some Surreal methods #98

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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
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.

None yet

1 participant