dates

38 views
Skip to first unread message

John Currey

unread,
Dec 13, 2021, 7:58:29 AM12/13/21
to SDQL API
Hi,

I think I made a mistake storing dates as integers.  Doing so is causing date math to fail.

Notice in the image, 20211213-20121205 works, but when the math has to cross over to a different month (20211213-20121121), it's not working the way I would like it to work. 
Dec13.PNG

Can dates be stored in a date format to accommodate date math?

Here's the query:


Joe Meyer

unread,
Dec 13, 2021, 8:24:18 AM12/13/21
to sdq...@googlegroups.com
John and SDQL API Friends,

That looks like a bug: thanks for the good report and link.

The intent is indeed for you to upload `date` as an integer and for the backend code to then convert this to the proper date object.

I've got my best Python programmer working on this and expect a solution soon.

C'est moi,

Joe Meyer
Sports Database LLC

--

---
You received this message because you are subscribed to the Google Groups "SDQL API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sdqlapi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sdqlapi/d1c29bcf-f627-4dd3-903a-7a0bd713af6an%40googlegroups.com.

Joe Meyer

unread,
Dec 13, 2021, 8:58:23 AM12/13/21
to sdq...@googlegroups.com
John and SDQL API Friends,

I believe that date is now being cast correctly as per the SDQL:

date,team,date-p:date-1 as 'rest',date-30@date-today=0 


best regards,

Joe Meyer
Sports Database LLC.

John Currey

unread,
Dec 13, 2021, 11:23:55 AM12/13/21
to SDQL API
Thank Joe, I'm glad you found the right man for the job! 😉

John Currey

unread,
Dec 13, 2021, 6:42:27 PM12/13/21
to SDQL API
So the plot thickens a little. I discovered I could not query my NHL games by date. Upon investigation, there seems to be a problem with importing dates as integers for the NHL. Here's an example:
Dec13b.PNG

Here's the URL:

Here's how my dictionary looks:
Dec13c.PNG

Thanks.

Joe Meyer

unread,
Dec 14, 2021, 9:49:07 AM12/14/21
to sdq...@googlegroups.com
John and SDQL API Friends,

I do not see an error here.

I see that you upload the date as an integer, and that the backend converts this to a customized 'Date8' object.

If you still see an error, please send a link to that error.

Best regards,

Joe Meyer
Sports Database LLC

John Currey

unread,
Dec 14, 2021, 3:01:33 PM12/14/21
to SDQL API
My mistake. I noticed that type(date) for the NFL, NCAAFB, and NBA used to show <class 'int>, and the NHL showed 
<class 'PyQL.py_tools.Date8'> and that caused me to believe that was the issue. The real problem was I spelled Kraken wrong. Sorry for the false alarm.

I see all sports now have Date8. 

Thanks. 

John Currey

unread,
Dec 15, 2021, 8:08:29 AM12/15/21
to SDQL API
Hi,

I'm still struggling with this in the NHL. This shows the data that the Devils recent games:
Dec15.PNG

Using this data statement, the API returns no results (i.e. {'headers': [], 'groups': []}):
d={"sdql": "date,team,o:team@team=Capitals and date=20211214"}

If I change the date to 20211211 or before, it works fine. For any date after 20211214, no results are returned via the API. The same happens for other teams. 

Joe Meyer

unread,
Dec 15, 2021, 10:10:28 AM12/15/21
to sdq...@googlegroups.com
John and SDQL API Friends,

I do not see an error there. 

This SDQL works as expected:

date,team,o:team@team=Capitals and date=20211217

best regards,

Joe Meyer
Sports  Database LLC

John Currey

unread,
Dec 15, 2021, 7:29:41 PM12/15/21
to SDQL API
I believe my issue was that I was seeing other people's data in the UI thinking it was mine. My code was not finding it, and I was tricked. 

Thanks. 

Reply all
Reply to author
Forward
0 new messages