uberfastman / fantasy-football-metrics-weekly-report

Command line application to create weekly reports (containing stats, metrics, and rankings) for Fantasy Football leagues on the following platforms: Yahoo, Fleaflicker, Sleeper, ESPN.
GNU General Public License v3.0
193 stars 46 forks source link

error with positions #91

Closed bweezy21 closed 4 years ago

bweezy21 commented 4 years ago

Hello, my league has an additional flex position that your script doesn't handle. Its a sleeper league and the api is REC_FLEX can be WR or TE. could you add this to the script. In the meantime I'll try to see if I can add it to the if check on the sleeper.py file.

uberfastman commented 4 years ago

@bweezy21 added! Please pull the latest on develop and confirm that it works for you now!

bweezy21 commented 4 years ago

getting this error (Windows 10 cmd prompt):

Traceback (most recent call last): File "main.py", line 241, in report = select_league( File "main.py", line 155, in select_league return FantasyFootballReport(week_for_report=week_for_report, File "c:\Scripts\Fantasy Football\fantasy-football-metrics-weekly-report\report\builder.py", line 106, in init self.league = league_data_factory( File "c:\Scripts\Fantasy Football\fantasy-football-metrics-weekly-report\dao\utils.py", line 133, in league_data_factory return fleaflicker_league.map_data_to_base(BaseLeague) File "c:\Scripts\Fantasy Football\fantasy-football-metrics-weekly-report\dao\sleeper.py", line 594, in map_data_to_base raise ValueError("Player position missing! Check data!") ValueError: Player position missing! Check data!

bweezy21 commented 4 years ago

forgot to mention platform is sleeper. sorry.

uberfastman commented 4 years ago

Hmm... it looks like it mentioned fleaflicker in your error stack trace above... what command are you running to launch the report? Like, with which flags? Also, what do you have configured in config.ini? If you're running it for Sleeper, it shouldn't be trying to do any mapping using the Fleaflicker platform template. What is the initial configuration output when you run it @bweezy21 ?

bweezy21 commented 4 years ago

yeah thats a variable in the utils.py file. looks like maybe a copy paste error but is otherwise no big deal. i had it changed locally as it threw me off at first as well but wanted to make sure i had it back to the original for the error message.

uberfastman commented 4 years ago

Ok, I think I'm uncertain about your issue then... the app should not be trying to make a Fleaflicker league if you're running it for Sleeper, so if you're still seeing the above error after trying to run it for Sleeper, then please let me know! Otherwise, can you confirm that things are working/running properly @bweezy21 ? I don't want to close this issue until I know there isn't some other underlying problem.

bweezy21 commented 4 years ago

its not. see line 123 in utils.py. the variable name is fleaflicker probably should be sleeper or something but as long as you are consistent it really doesn't matter.

i am indeed running it for sleeper

config.txt

to me what it is saying is that the sleeper api is returning a player without a position filled out. i could be wrong as i don't know enough about the sleeper api. just got into it last night when i stumbled upon your script here.

adding logs: out.log

uberfastman commented 4 years ago

@bweezy21 great catch, it 100% is a copy/paste typo haha.

Okay, so that aside, I have to figure out what position is missing. Could you share your sleeper league ID? Sleeper's API is read only so I only need the ID to test with your league.

bweezy21 commented 4 years ago

yup - 507403133618331648

bweezy21 commented 4 years ago

thank you! by the way. sorry for not saying that earlier.

uberfastman commented 4 years ago

Thanks! Also, I'm silly, as you gave me your config.ini which had the league ID. But no problem! I already know what I forgot to do when I added the REC_FLEX slot.

uberfastman commented 4 years ago

Alright @bweezy21 , this time it should be actually fixed... I was able to run the report with your league (although I had to turn off playoff projects, I'm assuming your league must have no playoffs...? I should probably include a check for that.). Please confirm if the latest works for you!

bweezy21 commented 4 years ago

I'll check as soon as I get back home. Also weird there are playoffs. 10 team league, no divisions, 6 team playoff weeks 14,15,16

bweezy21 commented 4 years ago

ok this issue seems to be fixed. however i did not get a report still. got a different error. should i open a new issue not to clutter this one?

uberfastman commented 4 years ago

Yeah, for the sake of clarity, a new issue would be helpful! Thanks for all the feedback @bweezy21