Giter VIP home page Giter VIP logo

Comments (15)

uberfastman avatar uberfastman commented on June 30, 2024

Hi @MeanGreen256, what I'm guessing is that you might have used the report app before, and when I upgraded it this season I also upgraded the YFPY dependency library as well, so you would need to rebuild the docker images by running docker compose up -d --build (or just running docker compose build followed by docker compose up -d, which will then install the latest dependencies the app needs to run!

I'm closing this as based on the stack trace I think that's the issue, but please feel free to open it again if it's still a problem.

from fantasy-football-metrics-weekly-report.

MeanGreen256 avatar MeanGreen256 commented on June 30, 2024

Hey @uberfastman. I took your advice and started with a clean repo of the application. I brought in the yahoo configuration for ID and private key. I deleted the old docker images and built a clean one using your instructions as well. I'm still getting the same "scoreboard" error

fantasy-football-metrics-weekly-report % docker exec -it fantasy-football-metrics-weekly-report-app-1 python main.py 2022-10-13 20:13:45,854 - utils.report_tools - INFO - The Fantasy Football Metrics Weekly Report app is up to date and running v13.0.2. Generate report for default league? (y/n) -> y Generate report for default week? (y/n) -> y 2022-10-13 20:13:54,080 - report.builder - INFO - Generating Yahoo Fantasy Football report with settings: league id: 654597 game id: nfl week: selected/default save_data: False refresh_web_data: False playoff_prob_sims: None break_ties: False dq_ce: False dev_offline: False test: False on Oct 13, 2022... 2022-10-13 20:13:54,103 - report.builder - INFO - Retrieving fantasy football data from Yahoo API... Traceback (most recent call last): File "/app/main.py", line 267, in <module> report = select_league( File "/app/main.py", line 154, in select_league return FantasyFootballReport(week_for_report=week_for_report, File "/app/report/builder.py", line 109, in __init__ self.league = league_data_factory( File "/app/utils/report_tools.py", line 465, in league_data_factory yahoo_league = YahooLeagueData( File "/app/dao/platforms/yahoo.py", line 160, in __init__ self.matchups_by_week[wk] = self.yahoo_data.retrieve( File "/usr/local/lib/python3.10/site-packages/yfpy/data.py", line 187, in retrieve return self.get(yf_query, params) File "/usr/local/lib/python3.10/site-packages/yfpy/data.py", line 93, in get return yf_query(**params) File "/usr/local/lib/python3.10/site-packages/yfpy/query.py", line 1682, in get_league_matchups_by_week return self.query( File "/usr/local/lib/python3.10/site-packages/yfpy/query.py", line 268, in query raw_response_data = reformat_json_list(raw_response_data)[data_key_list[i]] File "/usr/local/lib/python3.10/collections/__init__.py", line 986, in __getitem__ return self.__missing__(key) # support subclasses that define __missing__ File "/usr/local/lib/python3.10/collections/__init__.py", line 978, in __missing__ raise KeyError(key) KeyError: 'scoreboard'

from fantasy-football-metrics-weekly-report.

uberfastman avatar uberfastman commented on June 30, 2024

@MeanGreen256 I'm in the process of making a little dependency upgrade update to the report app, but in the meantime, could you share some more info about your league? Is your league a head-to-head league? Is it a private league or a public league? If public, what is the league ID? Do you have any non-traditional and/or unusual settings?

from fantasy-football-metrics-weekly-report.

MeanGreen256 avatar MeanGreen256 commented on June 30, 2024

@uberfastman Yeah sure thing.
The league ID is: 654597
It's a private league.
It's a yahoo league, that's a normal 12 man "standard scoring" league.
The only odd item for this years league is we started on week 2.
I don't believe we have any other odd settings or scorings. Just a standard league.

from fantasy-football-metrics-weekly-report.

MeanGreen256 avatar MeanGreen256 commented on June 30, 2024

@uberfastman I believe I found the first issue and I believe it relates to my league having started on week 2.
I edited "dao/platforms/yahoo.py" line:160
for wk in range(2, self.num_regular_season_weeks + 1):. I changed the for loop to start on week 2.

I however then ran into my next error:
2022-10-13 21:45:50,204 - report.builder - INFO - Retrieving fantasy football data from Yahoo API... Traceback (most recent call last): File "/app/main.py", line 267, in <module> report = select_league( File "/app/main.py", line 154, in select_league return FantasyFootballReport(week_for_report=week_for_report, File "/app/report/builder.py", line 109, in __init__ self.league = league_data_factory( File "/app/utils/report_tools.py", line 476, in league_data_factory return yahoo_league.map_data_to_base(BaseLeague) File "/app/dao/platforms/yahoo.py", line 448, in map_data_to_base league_team = league.teams_by_week.get(str(week)).get(str(team_id)) # type: BaseTeam AttributeError: 'NoneType' object has no attribute 'get'

from fantasy-football-metrics-weekly-report.

uberfastman avatar uberfastman commented on June 30, 2024

@MeanGreen256 yeah that tidbit of info definitely explains the missing "scoreboard" key initially. I've never actually tried to run the report for a league that didn't start on week one, so I'm not surprised that it broke some things. I'll see if I can figure out a fix, although I don't have a league to test against since your league is private, so it could be tricky. Might have to end up being a feature request unfortunately.

from fantasy-football-metrics-weekly-report.

uberfastman avatar uberfastman commented on June 30, 2024

@MeanGreen256 if you could do me a favor and pull the latest updates to the app in v13.1.0 (see PR #180 for reference) and try running the report for your league that started in week 2. As far as I've been able to test, it should now automatically detect the start week for Yahoo leagues (thankfully Yahoo makes that available) and adjust accordingly. I also added a command line flag (-k) that can be used to manually set the start week.

Hopefully this gets your sorted, but please reopen the issue if the fix isn't working!

from fantasy-football-metrics-weekly-report.

uberfastman avatar uberfastman commented on June 30, 2024

As an update @MeanGreen256, I've actually released v14.0.0 now (dropped support for Python 3.8), which also includes all the above updates.

from fantasy-football-metrics-weekly-report.

MeanGreen256 avatar MeanGreen256 commented on June 30, 2024

@uberfastman that’s awesome man! I’ll give it a try this evening and post my feedback after I pull the new version and do a clean build.

from fantasy-football-metrics-weekly-report.

uberfastman avatar uberfastman commented on June 30, 2024

@MeanGreen256 great, thanks! Every year people find new edge cases, and while I can't support them all, this one seemed easy enough! Just never had anyone try to use it with a league that started late before.

from fantasy-football-metrics-weekly-report.

MeanGreen256 avatar MeanGreen256 commented on June 30, 2024

@uberfastman I totally understand and appreciate you looking into this! I did just run a clean build and it seems to advanced further past the original issues. I've not got the following error possibly with the bad boys data:
`Generate report for default league? (y/n) -> y
Generate report for default week? (y/n) -> y
2022-10-14 15:52:53,587 - report.builder - INFO -
Generating Yahoo Fantasy Football report with settings:
league id: 654597
game id: nfl
week: selected/default
start_week: default=1
save_data: False
refresh_web_data: False
playoff_prob_sims: None
break_ties: False
dq_ce: False
dev_offline: False
test: False
on Oct 14, 2022...
2022-10-14 15:52:53,609 - report.builder - INFO - Retrieving fantasy football data from Yahoo API...
2022-10-14 15:53:37,442 - report.builder - INFO - ...retrieved all fantasy football data from Yahoo API in 0:00:43.832726

2022-10-14 15:53:37,447 - report.builder - INFO - Retrieving bad boy data from https://www.usatoday.com/sports/nfl/arrests/ website...
Traceback (most recent call last):
File "/app/main.py", line 273, in
report = select_league(
File "/app/main.py", line 157, in select_league
return FantasyFootballReport(week_for_report=week_for_report,
File "/app/report/builder.py", line 126, in init
self.bad_boy_stats = self.league.get_bad_boy_stats(self.save_data, self.dev_offline, self.refresh_web_data)
File "/app/dao/base.py", line 235, in get_bad_boy_stats
return BadBoyStats(
File "/app/calculate/bad_boy_stats.py", line 123, in init
arrests_data = resp_json["data"]["Result"]
TypeError: 'int' object is not subscriptable
`

from fantasy-football-metrics-weekly-report.

uberfastman avatar uberfastman commented on June 30, 2024

Try waiting a bit and running it again. I was running into that this morning as well, and I suspect it was happening when that site wasn't available at times due to too much traffic or if they're having reliability issues.

from fantasy-football-metrics-weekly-report.

MeanGreen256 avatar MeanGreen256 commented on June 30, 2024

@uberfastman Will do, I'll try it every so often this afternoon and let you know the results. Thanks!

from fantasy-football-metrics-weekly-report.

MeanGreen256 avatar MeanGreen256 commented on June 30, 2024

@uberfastman Got it working and it looks beautiful. Thanks so much for the update!

from fantasy-football-metrics-weekly-report.

uberfastman avatar uberfastman commented on June 30, 2024

@MeanGreen256 fantastic! So glad I could get it sorted for you, and now the bonus is the app can support leagues that start later than week 1. Thanks for all the helpful feedback!

from fantasy-football-metrics-weekly-report.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.