Skip to content

fix: relax the schema check in update mixin #1755

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

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

alaeddine-13
Copy link
Member

The current schema check in the UpdateMixin is strict and does not allow updating in cases the schema of both documents are similar but not exactly the same.
For instance, if are dynamically generated schemas but have the same fields and field types, the check will still evaluate to false and it would not be possible to update the documents.
This case happens in Jina's reduce procedure where the schemas are retrieved and generated dynamically.
This PR relaxes the check and allows checking whether the fields of the schemas are similar instead.

@github-actions
Copy link

📝 Docs are deployed on https://ft-fix-update-mixin-relax-check--jina-docs.netlify.app 🎉

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.39% 🎉

Comparison is base (6c77112) 83.60% compared to head (a04d183) 84.99%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1755      +/-   ##
==========================================
+ Coverage   83.60%   84.99%   +1.39%     
==========================================
  Files         134      134              
  Lines        8842     8844       +2     
==========================================
+ Hits         7392     7517     +125     
+ Misses       1450     1327     -123     
Flag Coverage Δ
docarray 84.99% <100.00%> (+1.39%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
docarray/base_doc/mixins/update.py 92.30% <100.00%> (+0.17%) ⬆️

... and 11 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alaeddine-13 alaeddine-13 merged commit 46c5dfd into main Aug 22, 2023
@alaeddine-13 alaeddine-13 deleted the fix-update-mixin-relax-check branch August 22, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants