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 patch method for submission resource #809

Merged
merged 3 commits into from
Jun 22, 2023
Merged

add patch method for submission resource #809

merged 3 commits into from
Jun 22, 2023

Conversation

yang-ruoxi
Copy link
Member

  • Added build_patch_data in Submission resource to update fields in a collection
  • The will accept the query['update'] parameters to update corresponding fields in a collection, using the $set operator:
    self.store_collection.update_one(filter=query['criteria'], {'$set': query["update"]})
  • To accommodate this change, added "update" into STORE_PARAMS

@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Patch coverage: 74.28% and project coverage change: -0.12 ⚠️

Comparison is base (6f41fcf) 88.23% compared to head (841dcb4) 88.12%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #809      +/-   ##
==========================================
- Coverage   88.23%   88.12%   -0.12%     
==========================================
  Files          44       44              
  Lines        3588     3620      +32     
==========================================
+ Hits         3166     3190      +24     
- Misses        422      430       +8     
Impacted Files Coverage Δ
src/maggma/api/utils.py 95.94% <ø> (ø)
src/maggma/api/resource/submission.py 80.64% <74.28%> (-1.47%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@munrojm
Copy link
Member

munrojm commented Jun 22, 2023

@yang-ruoxi, this looks great! Do you mind adding a test for patching to test_submission_resource?

@yang-ruoxi
Copy link
Member Author

thanks, and good point! Will do that

@munrojm munrojm merged commit a01d007 into main Jun 22, 2023
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