nfldb
nfldb copied to clipboard
LA Rams Schedule Is Not Set Past Current Week
Most teams have their future games included in the database even if they are yet to be played, which makes it possible to build a team's upcoming schedule out.
The LA Rams don't have their games in the DB and after an update they still don't show up in mine. When doing a search for LA games in the current season the only games returned are those that are already completed, but none in the future.
See below for results of a query for the LA games compared to those from the Patriots which are what I see for all other active teams.
Is this an issue with an API the feed is built on, or something I can fill in and submit?
You're right. Does appear to be an issue.
import nfldb
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=2016, week=17, season_type='Regular')
for game in q.as_games():
print game
print '-'*79
q = nfldb.Query(db)
q.game(season_year=2016, week=17, season_type='Regular', team='ARI')
for game in q.as_games():
print game
print '-'*79
q = nfldb.Query(db)
q.game(season_year=2016, week=17, season_type='Regular', team='LA')
for game in q.as_games():
print game
print '-'*79
Regular 2016 week 17 on 01/01 at 12:00PM, NO (0) at ATL (0)
Regular 2016 week 17 on 01/01 at 12:00PM, BAL (0) at CIN (0)
Regular 2016 week 17 on 01/01 at 12:00PM, GB (0) at DET (0)
Regular 2016 week 17 on 01/01 at 12:00PM, JAC (0) at IND (0)
Regular 2016 week 17 on 01/01 at 12:00PM, NE (0) at MIA (0)
Regular 2016 week 17 on 01/01 at 12:00PM, CHI (0) at MIN (0)
Regular 2016 week 17 on 01/01 at 12:00PM, BUF (0) at NYJ (0)
Regular 2016 week 17 on 01/01 at 12:00PM, DAL (0) at PHI (0)
Regular 2016 week 17 on 01/01 at 12:00PM, CLE (0) at PIT (0)
Regular 2016 week 17 on 01/01 at 12:00PM, CAR (0) at TB (0)
Regular 2016 week 17 on 01/01 at 12:00PM, HOU (0) at TEN (0)
Regular 2016 week 17 on 01/01 at 12:00PM, NYG (0) at WAS (0)
Regular 2016 week 17 on 01/01 at 03:25PM, OAK (0) at DEN (0)
Regular 2016 week 17 on 01/01 at 03:25PM, ARI (0) at UNK (0)
Regular 2016 week 17 on 01/01 at 03:25PM, KC (0) at SD (0)
Regular 2016 week 17 on 01/01 at 03:25PM, SEA (0) at SF (0)
-------------------------------------------------------------------------------
Regular 2016 week 17 on 01/01 at 03:25PM, ARI (0) at UNK (0)
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
The file schedule.json correctly shows that this game pits ARI at LA.
[
"2017010113",
{
"away": "ARI",
"day": 1,
"eid": "2017010113",
"gamekey": "57154",
"home": "LA",
"meridiem": "PM",
"month": 1,
"season_type": "REG",
"time": "4:25",
"wday": "Sun",
"week": 17,
"year": 2016
}
],
But it looks like the database might have been built before a fix was implemented?
nfldb=> select * from game where season_year = 2016 and week = 17;
gsis_id | gamekey | start_time | week | day_of_week | season_year | season_type | finished | home_team | home_score | home_score_q1 home_score_q2 | home_score_q3 | home_score_q4 | home_score_q5 | home_turnovers | away_team | away_score | away_score_q1 | away_score_q2 | away_score_q3 | away_score_q4 | away_score_q5 | away_turnovers | time_inserted | time_updated
------------+---------+------------------------+------+-------------+-------------+-------------+----------+-----------+------------+---------------+---------------+---------------+---------------+---------------+----------------+-----------+------------+---------------+---------------+---------------+---------------+---------------+----------------+-------------------------------+-------------------------------
...
2017010113 | 57154 | 2017-01-01 15:25:00-06 | 17 | Sunday | 2016 | Regular | f | UNK | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ARI | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2016-09-07 15:41:04.909826-05 | 2016-09-07 15:41:04.909826-05
...
I think I had this issue when first updating the db to add the LA rams, but it's no longer a problem for me.
nfldb=> select season_year,season_type,week,away_team,home_team from game where season_year = 2016 and (home_team = 'LA' or away_team = 'LA') order by season_type,week;
season_year | season_type | week | away_team | home_team
-------------+-------------+------+-----------+-----------
2016 | Preseason | 1 | DAL | LA
2016 | Preseason | 2 | KC | LA
2016 | Preseason | 3 | LA | DEN
2016 | Preseason | 4 | LA | MIN
2016 | Regular | 1 | LA | SF
2016 | Regular | 2 | SEA | LA
2016 | Regular | 3 | LA | TB
2016 | Regular | 4 | LA | ARI
2016 | Regular | 5 | BUF | LA
2016 | Regular | 6 | LA | DET
2016 | Regular | 7 | NYG | LA
2016 | Regular | 9 | CAR | LA
2016 | Regular | 10 | LA | NYJ
2016 | Regular | 11 | MIA | LA
2016 | Regular | 12 | LA | NO
2016 | Regular | 13 | LA | NE
2016 | Regular | 14 | ATL | LA
2016 | Regular | 15 | LA | SEA
2016 | Regular | 16 | SF | LA
2016 | Regular | 17 | ARI | LA
Try searching for 'UNK' home and away teams. select season_year,season_type,week,away_team,home_team from game where season_year = 2016 and (home_team = 'UNK' or away_team = 'UNK'); If you find any hits you can run delete from game where home_team = 'UNK' or away_team = 'UNK'; and then re-rerun nfldb-update and it should resolve the issue.
The problem was resolved in the last commit https://github.com/BurntSushi/nfldb/commit/980cb8f8d92bc2492aa89053295480e16c8b38e7 but you probably ran an nfldb-update while running version 0.2.16 before updating to 0.2.17
Thanks @andr3w321 that process did work to fix the issue for me. Is there something we can do that would check for diffs between existing DB rows and the most current version and update automatically without causing a huge overhead?
I had this same issue as a new install that I did on Sep 13, 2016 15:10 CST. Running 0.2.17. @andr3w321 fix helped me