Skip to content

whisper-fetch: fix timestr when using --drop #342

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmzullinger
Copy link

Filtering the values list when --drop is set happens too early for the non-json output. When looping over the values we expect to be able to set the time string based on the number of times through the loop, adding the step value on each pass. With empty values stripped, the time gets further off for each value that is dropped.

Move the drop filtering function to the appropriate places for both json and plain test output.

Testing on databases with more than a year of data and many empty values, the time to execute is no different, so we should not be regressing in any significant way. Though even if we were, it is better to be accurate than fast if one or the other must be picked.

Fixes #250, fixes #305.

@tmzullinger
Copy link
Author

This more or less duplicates PR#306. I did the work before I looked through the issues and PR's.

I don't much care which one is merged, though I think this is a slightly smaller and more concise change (but am obviously biased).

Apart from the whitespace changes to adjust the indent in the non-json loop, the diffstat is 3 insertions(+), 1 deletion(-).

Filtering the values list when --drop is set happens too early for the
non-json output.  When looping over the values we expect to be able to
set the time string based on the number of times through the loop,
adding the step value on each pass.  With empty values stripped, the
time gets further off for each value that is dropped.

Move the drop filtering function to the appropriate places for both json
and plain test output.

Testing on databases with more than a year of data and many empty
values, the time to execute is no different, so we should not be
regressing in any significant way.  Though even if we were, it is better
to be accurate than fast if one or the other must be picked.

Fixes graphite-project#250, fixes graphite-project#305.
@tmzullinger tmzullinger force-pushed the fetch-fix-drop-times branch from 9538637 to f215ce3 Compare March 15, 2025 15:03
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.

[BUG] whisper-fetch.py --drop incorrect timestamps drop nulls and drop zeros returns incorrect timestamp
1 participant