Rookie league import errors

Help
2014-06-27
2014-06-29
  • Michael Thain

    Michael Thain - 2014-06-27

    It seems when importing 2013 ROK games there are some teams that have an abbreviation more than 3 characters long. So I get the below errors. I know very little Python so I tried to go through the code and figure out a fix but to no avail. Is there a fix for this?

    SQLException: DataError(1406, u"Data too long for column 'tz_aw_lg_gen' at row 1")

    INFO 2014-06-25 00:32:07,698 loader.logException.44 resuming
    ERROR 2014-06-25 00:32:07,698 loader.logException.45 gid_2013_08_28_rngrok_athrok_1
    INFO 2014-06-25 00:32:07,700 bbos.main.55 loading:gid_2013_08_28_royrok_angrok_1
    INFO 2014-06-25 00:32:13,709 loader.logException.37 unable to execute: INSERT into gameday.gameDetail (gameName , home_file_code, scheduled_innings, home_team_id, away_team_errors, venue, home_win, home_division, outs, away_team_name, venue_w_chan_loc, ind, away_time_zone, top_inning, venue_id, inning, home_team_name, home_team_hits, time_hm_lg, home_league_id, home_sport_code, aw_lg_ampm, id, away_file_code, away_time, away_win, away_team_id, gameday_sw, away_name_abbrev, away_division, home_ampm, home_loss, league, away_team_runs, tz_aw_lg_gen, tz_hm_lg_gen, home_time, hm_lg_ampm, time_aw_lg, home_code, game_pk, away_team_city, away_ampm, day, home_team_city, home_team_runs, ampm, home_name_abbrev, away_loss, game_type, time_zone, away_sport_code, home_time_zone, away_code, status, time, away_team_hits, home_team_errors, away_league_id) VALUES ("gid_2013_08_28_royrok_angrok_1", "t404", "9", "404", "2", "Tempe Diablo Stadium", "30", "E", "0", "AZL Royals", "USAZ0233", "F", "MST", "N", "2500", "11", "AZL Angels", "9", "7:00:00", "121", "rok", "PM", "2013/08/28/royrok-angrok-1", "t412", "7:00:00", "22", "412", "N", "ROY", "W", "PM", "25", "AZL", "7", "MST", "MST", "7:00:00", "PM", "7:00:00", "ang", "366433", "AZL Royals", "PM", "WED", "AZL Angels", "8", "PM", "ANG", "33", "R", "ET", "rok", "MST", "roy", "Final", "10:00:00", "12", "2", "121");
    INFO 2014-06-25 00:32:13,709 loader.logException.42 due to: DataError(1406, u"Data too long for column 'tz_aw_lg_gen' at row 1")
    INFO 2014-06-25 00:32:13,709 loader.logException.43 Traceback (most recent call last):
    File "C:\Users\Mike\workspace\BBOS\src\bbos\gameday\persist\loader.py", line 29, in loadDO
    self.db.execute(statement)
    File "C:\Users\Mike\workspace\BBOS\src\bbos\db\db.py", line 28, in execute
    raise SQLException(e)
    SQLException: DataError(1406, u"Data too long for column 'tz_aw_lg_gen' at row 1")

     
  • Michael Thain

    Michael Thain - 2014-06-27

    Correction - on further examination it seems the timezone field tz_aw_lg_gen is 2 characters but its trying "MST".

     
  • Michael Thain

    Michael Thain - 2014-06-28

    Ok it looks like something didn't work. I went into every table in the MySQL database and deleted everything with a gamename like gid_2013 and 'rok' at positions 19 and 26 (in every table). Then I double checked to make sure all those records were gone. Then when I ran the code for rok for 2013, it skipped every game and said "skipping previously loaded". Where does the BBOS code look to see if a game has already been loaded?

     
    • Deez Nutz

      Deez Nutz - 2014-06-28

      If the game is in the games table it won't reload it. You want to delete
      from all the table or at least the games tables and any other you think are
      missing data. Then live with failures or duplicate data on any that you
      did not delete. If you know the names of the games to be deleted you can
      run bbos.py -delete game name where game name is god_2013-47-milgat ect.
      On Jun 28, 2014 2:11 PM, "Michael Thain" mikethain@users.sf.net wrote:

      Ok it looks like something didn't work. I went into every table in the
      MySQL database and deleted everything with a gamename like gid_2013 and
      'rok' at positions 19 and 26 (in every table). Then I double checked to
      make sure all those records were gone. Then when I ran the code for rok for
      2013, it skipped every game and said "skipping previously loaded". Where
      does the BBOS code look to see if a game has already been loaded?


      Rookie league import errors
      https://sourceforge.net/p/baseballonastic/discussion/820145/thread/3e4ec7be/?limit=25#60f5


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/baseballonastic/discussion/820145/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Michael Thain

    Michael Thain - 2014-06-29

    Thanks Deez I tried again and it worked. I think the first time I must have ran Select instead of Delete on some of the tables.

    But then upon running it again, I found a separate issue. The original thing i thought I saw is still a problem - some of the team abbreviations are more than 3 characters. Should I just extend the size of the abbreviation field, or is there a cleaner way to handle this in the Python code?

    INFO 2014-06-29 14:41:41,460 bbos.main.55 loading:gid_2013_05_13_vtbrok_vcurok_1
    INFO 2014-06-29 14:41:44,398 loader.logException.37 unable to execute: INSERT into gameday.gameDetail (gameName , status, scheduled_innings, home_league_id, away_team_errors, venue, home_win, outs, away_team_name, ind, away_time_zone, top_inning, venue_id, inning, home_team_name, home_team_hits, home_team_id, home_sport_code, id, away_time, away_win, away_team_id, gameday_sw, away_name_abbrev, home_file_code, home_ampm, home_loss, league, away_team_runs, home_team_errors, home_time, away_file_code, home_code, game_pk, away_team_city, away_ampm, day, home_team_city, home_team_runs, ampm, home_name_abbrev, away_loss, game_type, time_zone, away_sport_code, home_time_zone, away_code, time, away_team_hits, away_league_id) VALUES ("gid_2013_05_13_vtbrok_vcurok_1", "Final", "9", "134", "2", "Generic VST", "0", "3", "VSL Rays", "F", "VST", "N", "4270", "9", "VSL Cubs", "11", "652", "rok", "2013/05/13/vtbrok-vcurok-1", "11:00:00", "1", "1590", "N", "VSL TB", "t652", "AM", "1", "VSL", "22", "6", "11:00:00", "t1590", "vcu", "369972", "VSL Rays", "AM", "MON", "VSL Cubs", "11", "AM", "VSL CHN", "0", "R", "ET", "rok", "VST", "vtb", "11:30:00", "21", "134");
    INFO 2014-06-29 14:41:44,401 loader.logException.42 due to: DataError(1406, u"Data too long for column 'away_name_abbrev' at row 1")
    INFO 2014-06-29 14:41:44,401 loader.logException.43 Traceback (most recent call last):

     
    • Michael Thain

      Michael Thain - 2014-06-29

      I changed the abbreviation field from Varchar(5) to Varchar(7) and this fixed it. The problem is there are some teams in teh rookie league like VSL Cubs with abbreviations like VSL CHC but changing the database field solved it.

       
      • Michael Thain

        Michael Thain - 2014-06-29

        Correction: Varchar(8) there are some that have a 1 at the end for 8 characters total.

         

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks