[MSNoise] [EXTERNAL] Re: database_tools.py query failing

Thomas Lecocq thomas.lecocq at oma.be
Mon Apr 7 14:24:44 UTC 2014


Oops, yes, sorry, that's what I meant ...

Thom

Le 07/04/2014 16:11, Abbott, Robert E a écrit :
> Did you mean MySQL? That is what I am using.
>
> Sent from my iPad
>
>> On Apr 7, 2014, at 1:13 AM, "Thomas Lecocq" <thomas.lecocq at oma.be> wrote:
>>
>> Rob,
>>
>> This seems linked to the way SQlite stores DATES fiels, I'm trying to do some tests today...
>>
>> Thom
>>
>> Le 01/04/2014 22:51, Abbott, Robert E a écrit :
>>> Thomas,
>>>
>>> When trying to use s04stack.py, I keep getting the message of "Found 000 updated days" when it is not true. I have tried changing the "–i" interval to no avail (e.g. s04stack.py -m -r -i 100). I think I have traced the problem to the following queries in database_tools.py:
>>>
>>> if pair == '%':
>>>          days = session.query(Job).filter(Job.day >= date1).filter(Job.day <= date2).filter(Job.type == type).filter(Job.lastmod >= lastmod).group_by(Job.day).order_by(Job.day).all()
>>>      else:
>>>          days = session.query(Job).filter(Job.pair == pair).filter(Job.day >= date1).filter(Job.day <= date2).filter(Job.type == type).filter(Job.lastmod >= lastmod).group_by(Job.day).order_by(Job.day).all()
>>>
>>> The call from s04stack.py goes to the ELSE conditions, but days == [ ] after the query.
>>>
>>> If I manually set 'pair = '%' on the line before, then 'days' returns what looks to be correct. As the only difference in the two queries is filtering by Job.pair, maybe that is the problem. I am attaching a screenshot of my jobs table.  I manually changed 'lastmod' at one point to yesterday in case the –i switch was not working correctly.
>>>
>>> I am on Mac OS X.
>>>
>>> Thanks,
>>> Rob
>>>
>>>
>>> +----------------------------+
>>> Robert E. Abbott, Ph.D.
>>> Sandia National Laboratories
>>> Geophysics Department MS 0750
>>> P.O. Box 5800
>>> Albuquerque, NM 87185-0750
>>> (505) 845-0266
>>> +----------------------------+
>>>
>>> +----------------------------+
>>> Robert E. Abbott, Ph.D.
>>> Sandia National Laboratories
>>> Geophysics Department MS 0750
>>> P.O. Box 5800
>>> Albuquerque, NM 87185-0750
>>> (505) 845-0266
>>> +----------------------------+
>>>
>>> _______________________________________________
>>> MSNoise mailing list
>>> MSNoise at mailman-as.oma.be
>>> http://mailman-as.oma.be/mailman/listinfo/msnoise
>> _______________________________________________
>> MSNoise mailing list
>> MSNoise at mailman-as.oma.be
>> http://mailman-as.oma.be/mailman/listinfo/msnoise
> _______________________________________________
> MSNoise mailing list
> MSNoise at mailman-as.oma.be
> http://mailman-as.oma.be/mailman/listinfo/msnoise



More information about the MSNoise mailing list