(0,0) vs. Timerange.until_now() in methods to find events to get all events ever inserted

Bug #490242 reported by Markus Korn
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
Low
Siegfried Gevatter

Bug Description

For the time_range argument, there are two ways to query for all events ever inserted in Zeitgeist,
  1.) using TimeRange.until_now(), which translates to (0, int(time.time()*1000))
  2.) (0,0)

Strictly speaking both intervals means sth. completely different, and we should only allow one way here.
I vote for 1.) as this is the most natural way.

As a side note: I *thought* we already decided to not allow (0,0) but I might be wrong.

Related branches

Markus Korn (thekorn)
description: updated
Revision history for this message
Seif Lotfy (seif) wrote :

I dont see it as a problem! Its like having two options!
Or are you worried about consistency?

Changed in zeitgeist:
status: New → Triaged
assignee: nobody → Seif Lotfy (seif)
importance: Undecided → Low
Revision history for this message
Seif Lotfy (seif) wrote :

Can we decide on this or not! I see this as a stupid bug that can be closed within minutes! :)

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

To even strengthen the argument for disallowing (0,0) we also have a TimeRange.always() that return the whole 64 bit range.

Revision history for this message
Siegfried Gevatter (rainct) wrote :

revision <email address hidden> (1318)
Author: Siegfried-Angel Gevatter Pujals <email address hidden>
Date: Wed 2010-01-27 00:11:58 +0100
Branch: zeitgeist-trunk
Bugs: https://launchpad.net/bugs/490242 fixed

    Don't threat zeros in TimeRanges specially. Now (0, 0) just mean
    "at the exact msec the UNIX Epoch started".

    The "let's make the API more difficult and SQL queries slower" commit :).

Changed in zeitgeist:
assignee: Seif Lotfy (seif) → Siegfried Gevatter (rainct)
milestone: none → 0.3.3
status: Triaged → Fix Released
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Siegfried: I can appreciate your concern with regards to query speed, but let's not put too much in it without having profiling data. I know for a fact that some DB engines check numeric bounds against their indexes, and if they are out of range simply drop the conditions from the optimized query. This would mean a slight overhead at query compile-time, but I assume that the Python sqlite module uses prepared statements which means that this cost is only a one-off...

Revision history for this message
Siegfried Gevatter (rainct) wrote :

Don't worry about it too much Mikkel, I just felt like using a nice commit name :).

While I'm not 101% convinced of this change, I can see how it makes more sense this way. It just annoys me that I now have to use some big random number when I try stuff with D-Feet instead of just (0,0), but it's not a big problem.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.