Re: [baseballonastic:discussion] Re: [baseballonastic:discussion] Problem with gid_2013_05_07_indaaa_swbaaa_1

Help
2014-07-18
2014-07-20
  • I'm at a little disadvantage because I don't load the bios, so I don't have a table of my own to look at.

    could you post the schema for your bio table? also if you can capture some error output which would show the data and which fields  they are being written to?

    Brian
     
    On 07/18/14, Michael Thain<mikethain@users.sf.net> wrote:
     

    Has anyone else been able to get the aaa 2013 playerbios to import? This is a fatal error that ends the script so I can't import any player bios after May 7. I don't even care if I lose one day of bios but I don't want to lose the whole season. Is there an easy workaround to skip this game?


    Re: [baseballonastic:discussion] Problem with
    gid_2013_05_07_indaaa_swbaaa_1


    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-07-19

    All of the fields are char or varchar:
    gameName varchar(35)
    first_name varchar(25)
    last_name varchar(25)
    weight varchar(4)
    dob char(10)
    pos char(2)
    jersey_number char(4)
    bats char(4)
    team char(3)
    id mediumint(6) UN
    heightFeet varchar(4)
    heightInches varcahr(4)
    type varchar(7)
    throws char(4)

    The output I included in my original message is all the error information I get. It just displays that stuff and quits. Not sure if there is somewhere I can find a more detailed log?

     
    • are any of these fields indexed? (the error you quoted said ‘index error’)
      do any say ‘not null’ in the schema?

      Brian

      From: Michael Thain
      Sent: Friday, July 18, 2014 22:30
      To: [baseballonastic:discussion]
      Subject: [baseballonastic:discussion] Re: [baseballonastic:discussion] Re: [baseballonastic:discussion] Problem with gid_2013_05_07_indaaa_swbaaa_1

      All of the fields are char or varchar:
      gameName varchar(35)
      first_name varchar(25)
      last_name varchar(25)
      weight varchar(4)
      dob char(10)
      pos char(2)
      jersey_number char(4)
      bats char(4)
      team char(3)
      id mediumint(6) UN
      heightFeet varchar(4)
      heightInches varcahr(4)
      type varchar(7)
      throws char(4)

      The output I included in my original message is all the error information I get. It just displays that stuff and quits. Not sure if there is somewhere I can find a more detailed log?


      [Re: [baseballonastic:discussion] Re: [baseballonastic:discussion]
      Problem with gid_2013_05_07_indaaa_swbaaa_1](https://sourceforge.net/p/baseballonastic/discussion/820145/thread/216bf17c/?limit=25#5745)


      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-07-19

    None of the fields are marked not null, and there are no indexes. I'm wondering if there is something in the Python code that is trying to split the height field into heightFeet and heightInches. Since there is no height value, maybe it's looking for a dash between two value and finding nothing. That's the only thing I can think of. But, I tried to unravel the Python code (looking at it in Eclipse) and I can't make sense of what it's really doing. It's broken up into so many pieces and I can't figure out how to follow it to the point where it's splitting that value. I'm not very good at Python.

     
  • Michael Thain
    Michael Thain
    2014-07-19

    Ok I found the place in the code that is parsing the height value. It looks like it is only trying to parse it when it is not null...

    def __parsePlayerTag__(self, playerTag):
        playerBio = self.mapTagWithList(playerTag, GamedayConfig.parser_playerbio_player)
    
        playerHasHeight = len(playerBio['height']) != 0
        playerHeightNotNull = "null" != playerBio['height']
    
        if playerHasHeight and playerHeightNotNull:
            (feet, inches) = playerBio['height'].split('-')
            playerBio['heightFeet'] = feet
            playerBio['heightInches'] = inches
    
        del playerBio['height']
    
        self.playerBios.append(playerBio)
    
     
    • Deez Nutz
      Deez Nutz
      2014-07-20

      Sorry, I was in the northwoods this week and only returned to the interweb
      today. The error is from Python, not SQL. I will take a look at what
      might fix it.

      On Sat, Jul 19, 2014 at 11:57 AM, Michael Thain mikethain@users.sf.net
      wrote:

      Ok I found the place in the code that is parsing the height value. It
      looks like it is only trying to parse it when it is not null...

      def parsePlayerTag(self, playerTag):
      playerBio = self.mapTagWithList(playerTag, GamedayConfig.parser_playerbio_player)

      playerHasHeight = len(playerBio['height']) != 0
      playerHeightNotNull = "null" != playerBio['height']
      
      if playerHasHeight and playerHeightNotNull:
          (feet, inches) = playerBio['height'].split('-')
          playerBio['heightFeet'] = feet
          playerBio['heightInches'] = inches
      
      del playerBio['height']
      
      self.playerBios.append(playerBio)
      

      [Re: [baseballonastic:discussion] Re: [baseballonastic:discussion]
      Problem with gid_2013_05_07_indaaa_swbaaa_1](
      https://sourceforge.net/p/baseballonastic/discussion/820145/thread/216bf17c/?limit=25#6774
      )


      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/

       
      • Deez Nutz
        Deez Nutz
        2014-07-20

        replace the section you have highlighted with the following and you will be
        good. I do not think I will put out a new version of BBOS with this fix,
        but it will go into the next one.

        for some reason josh harrison it missing a height in that game.

        <Player team="ind" id="639657" pos="--" type="batter" first_name="Josh" last_name="Harrison" jersey_number="" *height="" *weight="" bats="" throws="" dob="">

        http://gd2.mlb.com/components/game/aaa/year_2013/month_05/day_07/gid_2013_05_07_indaaa_swbaaa_1/batters/639657.xml

        def __parsePlayerTag__(self, playerTag):
            playerBio = self.mapTagWithList(playerTag,
        

        GamedayConfig.parser_playerbio_player)

            if 'height' in playerBio.keys():
                playerHasHeight = ('height' in playerBio) and
        

        (len(playerBio['height']) != 0)
        playerHeightNotNull = "null" != playerBio['height']

                if playerHasHeight and playerHeightNotNull:
                    (feet, inches) = playerBio['height'].split('-')
                    playerBio['heightFeet'] = feet
                    playerBio['heightInches'] = inches
        
                del playerBio['height']
        
            self.playerBios.append(playerBio)
        

        On Sat, Jul 19, 2014 at 9:12 PM, Kyle W. Willkomm <kyle.w.willkomm@gmail.com

        wrote:

        Sorry, I was in the northwoods this week and only returned to the interweb
        today. The error is from Python, not SQL. I will take a look at what
        might fix it.

        On Sat, Jul 19, 2014 at 11:57 AM, Michael Thain mikethain@users.sf.net
        wrote:

        Ok I found the place in the code that is parsing the height value. It
        looks like it is only trying to parse it when it is not null...

        def parsePlayerTag(self, playerTag):
        playerBio = self.mapTagWithList(playerTag, GamedayConfig.parser_playerbio_player)

        playerHasHeight = len(playerBio['height']) != 0
        playerHeightNotNull = "null" != playerBio['height']
        
        if playerHasHeight and playerHeightNotNull:
            (feet, inches) = playerBio['height'].split('-')
            playerBio['heightFeet'] = feet
            playerBio['heightInches'] = inches
        
        del playerBio['height']
        
        self.playerBios.append(playerBio)
        

        [Re: [baseballonastic:discussion] Re: [baseballonastic:discussion]
        Problem with gid_2013_05_07_indaaa_swbaaa_1](
        https://sourceforge.net/p/baseballonastic/discussion/820145/thread/216bf17c/?limit=25#6774
        )


        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-07-20

    Thank you so much Deez this totally fixed it!

    Also Brian, thanks for all your help trying to troubleshoot. I really appreciate it.