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

None returning dumper #642

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

None returning dumper #642

wants to merge 8 commits into from

Conversation

dvarrazzo
Copy link
Member

@dvarrazzo dvarrazzo commented Sep 17, 2023

Allow dumpers to return None, which would be then treated adequately in normal queries, in COPY, as part of composite objects such as Composite or Range.

In the C code, currently only Python dumpers are checked for returning None, because no builtin dumper does it and I don't expect anyone currently subclassing a C dumper. Should the need arise, we can allow None as C dumpers result in a bugfix.

Close #377

These are only the changes suggested by Mypy; no test added to verify
that the code paths actually work.

Only Python test fixed, no C yet.
Even if these classes never return None, this allows to create
subclasses returning None without making Mypy unhappy.

Similarly, annotate quote() methods as returning Buffer to allow
subclasses to return other types.
@dvarrazzo
Copy link
Member Author

This branch is now ready to review.

Will merge it in a few days, unless anyone has anything to point out.

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.

Cannot handle None in custom data dumper
1 participant