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 auto document wrapping in insert query #2097

Merged
merged 3 commits into from
May 24, 2024

Conversation

kartik4949
Copy link
Collaborator

@kartik4949 kartik4949 commented May 23, 2024

Description

fix #2043
https://github.com/SuperDuperDB/superduperdb/issues/2098

Related Issues

Checklist

  • Is this code covered by new or existing unit tests or integration tests?
  • Did you run make unit_testing and make integration-testing successfully?
  • Do new classes, functions, methods and parameters all have docstrings?
  • Were existing docstrings updated, if necessary?
  • Was external documentation updated, if necessary?

Additional Notes or Comments

@@ -394,9 +394,23 @@ def add_fold(self, fold: str):
@applies_to('insert_many', 'insert_one')
def documents(self):
"""Return the documents to insert."""

def _wrap_document(document):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move it to base and use it in ibis and mongodb both
@jieguangzhou @blythed ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a general logic, can we move it into query.__post_init__

@@ -394,9 +394,23 @@ def add_fold(self, fold: str):
@applies_to('insert_many', 'insert_one')
def documents(self):
"""Return the documents to insert."""

def _wrap_document(document):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a general logic, can we move it into query.__post_init__

superduperdb/backends/mongodb/query.py Show resolved Hide resolved
test/unittest/backends/base/test_query.py Show resolved Hide resolved
@kartik4949 kartik4949 merged commit 1068065 into superduper-io:main May 24, 2024
3 checks passed
@kartik4949 kartik4949 deleted the feat/2043 branch May 24, 2024 13:10
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.

[SERIALIZE] Make Document wrapping optional on insert
3 participants