Watson
Watson copied to clipboard
Aggregate doesn't seem to work with frames that cross day boudaries
Hi everyone
I just noticed the completely awesome aggregate feature in the development version (implemented by @brandomr and thanks!) and I was very thrilled because I really needed that while migrating tasks from another tool.
While migrating the tasks, I noticed that the command fails to show frames that cross day boundaries. I recognize that this is a rare usecase, but none the less I feel that it would be worth fixing.
I can help with it if necessary, but if @brandomr want's to continue the work on this command I completely understand.
@KennethNielsen that is interesting and might not be such an edge case for developers 😉. I won't have time to work on this until at least next week or the week after, so if you're able to take a whack at it, awesome!
I'm curious what occurs when this happens/what output you see?
@brandomr the case that I had was a day that had only one frame, that ended after midnight. In that case the aggregate for that day was empty.
Hmm. As it turns out, this is a special case of report
with the same start and end date not returning any output for en event that is only partially within that day. This in turn is due to Frames.span
, Frames.filter
and Span.__contains__
not doing that. This means that we are all the way down to the most basic objects and behaviour.
So at that point there are basically two routes:
- Decide that for
report
, this is intended behaviour... and implementaggregate
without thereport
functionality. (This is a lot of work, duplicate effort and error prone). - At some level (
Frames.filter
and probablyreport
), introduce an (internal) option concerning frames that cross the boundaries. If this options is active, it will then replace the frames in question with pseudo frames with time spans that ends at the boundaries.
I tend to lean towards 2, especially considering that it can be implemented cleanly and without affecting any other functionality, but I would like some opinions before I start. What do you think @brandomr @jmaupetit?
I vote 2!
I just started using 1.7 and this is annoying. At first I thought I'm doing something wrong.
@loonies thanks for bumping this! @jmaupetit I agree on option 2. I'll take a look into fixing this next week. I'm glad to see that people are finding the feature useful (minus this bug)
@brandomr I hope you don't mind, but since I didn't see a PR I imagined you were busy, so I tried my hand at a fix. If you are already in progress with it, then if nothing else, it can serve as something to compare with.
@KennethNielsen that is awesome! I'm sorry to have fallen off this thread--things got busy but I am so glad you picked it up. Nice!
Any update on this one? I'll often do a long coding session that starts in the evening and ends after midnight. I use Watson to track my hours, which later get transcribed to my billing system. I just noticed large swaths of hours were missing.
@emarthinsen the PR (#277) is pending approval of the approach, since I didn't want to keep re-basing it until I had that and I think these guys are busy. Give it a thumbs up if you want to advance it a bit.
@emarthinsen, @brandomr @loonies the fix for this issue needs to be tested, would any of you mind. (Apologies of the get the message twice, but I was unaware if I could tag you in a PR that you didn't comment on)
Thanks a lot, I was bitten by this one. Certainly, errr... very rarely! ;-)