bug in client.py

Bug #490110 reported by Seif Lotfy on 2009-11-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
High
Unassigned

Bug Description

Fiddling with the client.py i found this error

i will write down the code first so u might understand where the problem is
--------------------------------------------------------------------------------------------------------------------------------------------------
def insert_events(self):
        self.event_dict.clear()
        event = Event()
        event.set_interpretation(Interpretation.VISIT_EVENT.uri)
        event2 = Event()
        event2.set_interpretation(Interpretation.MODIFY_EVENT.uri)

        self.zg.find_event_ids_for_templates([event], self.handle_events1, [self.time*1000, (self.time+86399)*1000], num_events=50000)

#HERE I GET 9 items

        self.zg.find_event_ids_for_templates([event2], self.handle_events2, [self.time*1000, (self.time+86399)*1000], num_events=50000)

#HERE I GET 13 items

        self.zg.find_event_ids_for_templates([event, event2], self.handle_events, [self.time*1000, (self.time+86399)*1000], num_events=50000)

#HERE I GET 126

    def handle_events1(self, x):
        print len(x)

    def handle_events2(self, x):
        print len(x)

    def handle_events(self, x=None):
        print "*************", len(x)

------------------------------------------------------------------------
here the output again:
9
13
************* 126
------------------------------------------------------------------------

AFAIK 9+13=22 and not 126!
somthing is wrong combining 2 event templates

Related branches

Seif Lotfy (seif) on 2009-11-29
Changed in zeitgeist:
milestone: none → 0.3.0
importance: Undecided → High

This bug is probably not in client.py, but rather inside resonance_engine.py, where we generate the SQL in find_eventids(). If you can write a test case that triggers this, then that would be great.

I don't know what Siegfrieds state of the no-more-querymancer branch is - the SQL generation code is probably rewritten there...

ok it is triggered yb my new UI but i will hack it

2009/11/30 Mikkel Kamstrup Erlandsen <email address hidden>

> This bug is probably not in client.py, but rather inside
> resonance_engine.py, where we generate the SQL in find_eventids(). If
> you can write a test case that triggers this, then that would be great.
>
> I don't know what Siegfrieds state of the no-more-querymancer branch is
> - the SQL generation code is probably rewritten there...
>
> --
> bug in client.py
> https://bugs.launchpad.net/bugs/490110
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Zeitgeist Framework: New
>
> Bug description:
> Fiddling with the client.py i found this error
>
> i will write down the code first so u might understand where the problem is
>
> --------------------------------------------------------------------------------------------------------------------------------------------------
> def insert_events(self):
> self.event_dict.clear()
> event = Event()
> event.set_interpretation(Interpretation.VISIT_EVENT.uri)
> event2 = Event()
> event2.set_interpretation(Interpretation.MODIFY_EVENT.uri)
>
> self.zg.find_event_ids_for_templates([event], self.handle_events1,
> [self.time*1000, (self.time+86399)*1000], num_events=50000)
>
> #HERE I GET 9 items
>
> self.zg.find_event_ids_for_templates([event2], self.handle_events2,
> [self.time*1000, (self.time+86399)*1000], num_events=50000)
>
> #HERE I GET 13 items
>
> self.zg.find_event_ids_for_templates([event, event2],
> self.handle_events, [self.time*1000, (self.time+86399)*1000],
> num_events=50000)
>
> #HERE I GET 126
>
> def handle_events1(self, x):
> print len(x)
>
> def handle_events2(self, x):
> print len(x)
>
> def handle_events(self, x=None):
> print "*************", len(x)
>
> ------------------------------------------------------------------------
> here the output again:
> 9
> 13
> ************* 126
> ------------------------------------------------------------------------
>
> AFAIK 9+13=22 and not 126!
> somthing is wrong combining 2 event templates
>
>

Seif has not been able to reproduce afaik, so marking as invalid

Changed in zeitgeist:
status: New → Invalid
Siegfried Gevatter (rainct) wrote :

So this was indeed a bug.

revision <email address hidden> (1211)
Author: Siegfried-Angel Gevatter Pujals <email address hidden>
Date: Mon 2009-12-07 12:07:27 +0100
Branch: zeitgeist-trunk
Bugs: https://launchpad.net/bugs/490110 fixed

    Fix bug in find_eventids where using more than one event
    template resulted in all but the first one ignoring the
    timestamp restriction.

    Also update the test case we created for bug #490110 to
    catch this problem now that we really know what it is.

Changed in zeitgeist:
milestone: 0.3.0 → 0.3.1
status: Invalid → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers