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

Add an optional bool flag to the write function to skip writing null fields #210

Open
alessio-locatelli opened this issue May 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@alessio-locatelli
Copy link

alessio-locatelli commented May 9, 2024

Function parameters example

def write(collection, tabular, *, exclude_none: bool = False):
    ...

Usage example

write(collection, df, exclude_none=True)

How

Replacing https://github.com/mongodb-labs/mongo-arrow/blob/main/bindings/python/pymongoarrow/api.py#L390 with

if exclude_none:
    yield {k:v for k, v in row.items() if v is not None}
else:
    yield row

did the job.

@blink1073
Copy link
Member

Hi @olk-m! I've opened https://jira.mongodb.org/browse/ARROW-233 to track the request.

@blink1073 blink1073 added the enhancement New feature or request label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants