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

DM-31941: Allow datastore.trash to remove unknown files and ingest to overwrite #578

Merged
merged 6 commits into from Sep 30, 2021

Conversation

timj
Copy link
Member

@timj timj commented Sep 28, 2021

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Sep 28, 2021

Codecov Report

Merging #578 (fb328a3) into master (448dc30) will increase coverage by 0.05%.
The diff coverage is 95.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #578      +/-   ##
==========================================
+ Coverage   83.54%   83.60%   +0.05%     
==========================================
  Files         242      242              
  Lines       30197    30306     +109     
  Branches     4493     4507      +14     
==========================================
+ Hits        25229    25337     +108     
- Misses       3780     3782       +2     
+ Partials     1188     1187       -1     
Impacted Files Coverage Δ
python/lsst/daf/butler/datastores/fileDatastore.py 79.95% <81.48%> (+0.39%) ⬆️
python/lsst/daf/butler/tests/_dummyRegistry.py 85.22% <100.00%> (ø)
tests/test_butler.py 97.44% <100.00%> (+0.11%) ⬆️
tests/test_datastore.py 99.61% <100.00%> (+0.02%) ⬆️
python/lsst/daf/butler/core/named.py 83.75% <0.00%> (+0.50%) ⬆️

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 448dc30...fb328a3. Read the comment docs.

@timj
Copy link
Member Author

timj commented Sep 29, 2021

@andy-slac I updated the trash commit to add some test coverage by turning on trust mode.

Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks good, couple of nitpick comments.

python/lsst/daf/butler/datastores/fileDatastore.py Outdated Show resolved Hide resolved
python/lsst/daf/butler/datastores/fileDatastore.py Outdated Show resolved Hide resolved
This matches datastore.put behavior and trusts that the
registry would not be asking for an overwrite unless
it had good reason to do so.
If you asked to delete two rows it would double up every
row that did not match. The "else" was indented the
wrong amount.
This allows some areas to be tested that use set()
datastore.trash() is optimized to scan the records table and
quickly move those records to the trash table for later
deletion.

For execution mode the files might be there but the records
won't be.  Therefore, to allow consistency for dataset pruning,
when trust mode is enabled the file system is examined and files
removed if they are present even if there are no records.
@timj timj merged commit 8f63872 into master Sep 30, 2021
@timj timj deleted the tickets/DM-31941 branch September 30, 2021 04:07
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.

None yet

2 participants