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

fix delete entries #782

Merged
merged 6 commits into from
May 18, 2022
Merged

fix delete entries #782

merged 6 commits into from
May 18, 2022

Conversation

wanglec
Copy link
Collaborator

@wanglec wanglec commented May 10, 2022

This PR fixes #780.

Description of changes

Drop the index_id field in the content of non-annotation-like entries. Instead, add it in the entry_dict. If a non-annotation-like entry is deleted, put a None placeholder in that place to maintain the index correctly. Get iterator and next or prev will skip the placeholder.

Possible influences of this PR.

May affect how to calculate the number of entries.

Test Conducted

Delete is tested with next/prev/get functions

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #782 (90b1f45) into master (61c44ac) will increase coverage by 0.06%.
The diff coverage is 96.42%.

@@            Coverage Diff             @@
##           master     #782      +/-   ##
==========================================
+ Coverage   80.94%   81.00%   +0.06%     
==========================================
  Files         249      249              
  Lines       18664    18702      +38     
==========================================
+ Hits        15108    15150      +42     
+ Misses       3556     3552       -4     
Impacted Files Coverage Δ
forte/data/base_store.py 70.45% <ø> (ø)
forte/data/data_store.py 87.25% <93.33%> (+2.44%) ⬆️
forte/common/constants.py 100.00% <100.00%> (ø)
tests/forte/data/data_store_test.py 93.30% <100.00%> (+0.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61c44ac...90b1f45. Read the comment docs.

@wanglec wanglec requested review from hepengfe, mylibrar and hunterhector and removed request for hepengfe May 11, 2022 19:51
forte/common/constants.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
forte/data/data_store.py Outdated Show resolved Hide resolved
@hunterhector hunterhector merged commit ccd4de3 into master May 18, 2022
mylibrar pushed a commit to mylibrar/forte that referenced this pull request May 18, 2022
* fix delete entries

* add return statements

* fix return values

* fix magic numbers and add none counter

* fix docstring and separate entry_dict

Co-authored-by: wanglechuan-gif <[email protected]>
Co-authored-by: Hector <[email protected]>
mylibrar pushed a commit to mylibrar/forte that referenced this pull request May 18, 2022
* fix delete entries

* add return statements

* fix return values

* fix magic numbers and add none counter

* fix docstring and separate entry_dict

Co-authored-by: wanglechuan-gif <[email protected]>
Co-authored-by: Hector <[email protected]>
hunterhector added a commit that referenced this pull request May 19, 2022
* Fix some issues in ontology doc

* redirect pipeline example in pipeline README.md due to invalid hyperl… (#791)

* redirect pipeline example in pipeline README.md due to invalid hyperlinks for ner models

* remove --use-feature=in-tree-build as this option is removed and it's enabled by default by pip

* fix delete entries (#782)

* fix delete entries

* add return statements

* fix return values

* fix magic numbers and add none counter

* fix docstring and separate entry_dict

Co-authored-by: wanglechuan-gif <[email protected]>
Co-authored-by: Hector <[email protected]>

Co-authored-by: Suqi Sun <[email protected]>
Co-authored-by: feipenghe <[email protected]>
Co-authored-by: wanglec <[email protected]>
Co-authored-by: wanglechuan-gif <[email protected]>
Co-authored-by: Hector <[email protected]>
@wanglec wanglec deleted the issue780 branch May 27, 2022 03:08
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.

Fix delete_entry in DataStore
3 participants