Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Hall-of-Fame Game #29

Closed
aakar opened this issue Jul 13, 2014 · 2 comments
Closed

Issue with Hall-of-Fame Game #29

aakar opened this issue Jul 13, 2014 · 2 comments

Comments

@aakar
Copy link

aakar commented Jul 13, 2014

Trying to load the rest of the 2014 schedule into the DB but throwing an error:
return super(RealDictCursor, self).execute(query, vars)
psycopg2.IntegrityError: new row for relation "game" violates check constraint "game_week_check"
DETAIL: Failing row contains (2014080300, 56426, 2014-08-04 00:00:00+00, 0, Sunday, 2014, Preseason, f, BUF, 0, 0, 0, 0, 0, 0, 0, NYG, 0, 0, 0, 0, 0, 0, 0, 2014-07-13 02:16:40.294716+00, 2014-07-13 02:16:40.294716+00).

@BurntSushi
Copy link
Owner

OK I've pushed a fix for this that will support all hall-of-fame games. This fix required modifying both nflgame and nfldb, so you'll need to make sure you've updated both. You should end up with nflgame 1.2.6 and nfldb 0.1.5.

Once that's done, you should be able to just run nfldb-update and everything will get fixed. (Note that this will also give you the full schedule for the upcoming 2014 preseason and regular season.) You can test it with this:

import nfldb

db = nfldb.connect()
q = nfldb.Query(db)

q.game(season_type='Preseason', week=0).sort(('gsis_id', 'asc'))
print '\n'.join(map(str, q.as_games()))

My output:

[andrew@Liger nfldb] python2 29.py 
Preseason 2009 week 0 on 08/09 at 08:00PM, BUF (18) at TEN (21)
Preseason 2010 week 0 on 08/08 at 08:00PM, DAL (16) at CIN (7)
Preseason 2012 week 0 on 08/05 at 08:00PM, ARI (10) at NO (17)
Preseason 2013 week 0 on 08/04 at 08:00PM, MIA (20) at DAL (24)
Preseason 2014 week 0 on 08/03 at 08:00PM, NYG (0) at BUF (0)

@BurntSushi
Copy link
Owner

Fixed in 8897dba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants