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-37499: Improve log message for datastore.mexists #848

Merged
merged 1 commit into from Jun 6, 2023
Merged

Conversation

timj
Copy link
Member

@timj timj commented Jun 6, 2023

  • Use different log message for single file vs single chunk vs multiple chunks.

Checklist

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

@timj timj marked this pull request as ready for review June 6, 2023 17:17
@timj timj requested a review from andy-slac June 6, 2023 17:18
if n_results == 1:
ref = list(chunk_result)[0]
log.log(
log_threshold,
Copy link
Member Author

Choose a reason for hiding this comment

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

It's possible this should be a DEBUG message since we don't log anything for the simple datastore.exists() API. The multi-chunk case if VERBOSE because it takes a significant amount of time to run and it's good to have feedback. The middle ground is the single chunk and whether the verbose vs debug depends on the amount of time that it took to do the existence check (9999 datasets being checked will obviously take much longer than 2 datasets).

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have strong opinion, but I'm a big fan of trying to keep things simple. 🙂 Logging everything at VERBOSE may be OK, as I think most people will run it with INFO.

Copy link
Member Author

Choose a reason for hiding this comment

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

We always run with VERBOSE during workflow execution (mainly because we need to issue log messages when things take a while in order to let people know that the task is still running).

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Patch coverage: 84.61% and project coverage change: -0.01 ⚠️

Comparison is base (22011a4) 87.93% compared to head (65d95fd) 87.93%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #848      +/-   ##
==========================================
- Coverage   87.93%   87.93%   -0.01%     
==========================================
  Files         268      268              
  Lines       35254    35262       +8     
  Branches     7393     7395       +2     
==========================================
+ Hits        31002    31008       +6     
- Misses       3112     3113       +1     
- Partials     1140     1141       +1     
Impacted Files Coverage Δ
python/lsst/daf/butler/datastores/fileDatastore.py 82.25% <81.81%> (-0.08%) ⬇️
tests/test_datastore.py 99.54% <100.00%> (+<0.01%) ⬆️

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

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, it took me some time to verify that logic works fine, but I hope it's not goint to be updated frequently.

@timj
Copy link
Member Author

timj commented Jun 6, 2023

I didn't have an easy way to test the chunking (and no programmatic way to shrink the chunk size) so that code path doesn't trigger in the tests.

* Use different log message for single file vs single chunk vs
  multiple chunks.
@timj timj merged commit 9585fe8 into main Jun 6, 2023
11 of 13 checks passed
@timj timj deleted the tickets/DM-37499 branch June 6, 2023 21:00
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