Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ff_starters() is missing data on no-opponent weeks in 2022. #393

Open
TheMathNinja opened this issue Feb 20, 2023 · 5 comments
Open

ff_starters() is missing data on no-opponent weeks in 2022. #393

TheMathNinja opened this issue Feb 20, 2023 · 5 comments

Comments

@TheMathNinja
Copy link
Contributor

TheMathNinja commented Feb 20, 2023

Describe the bug
ff_starters() function is skipping submitted starters in 2022 MFL league in some cases (apparently, when the franchise starting them does not have a weekly opponent, e.g. a Playoff Bye)

Reprex
ff_starters(mfl_connect(season = 2022, league_id = 22686, user_agent = "mikeyfili", rate_limit_number = 3, rate_limit_seconds = 6), 1:16, 2022)

`mfl_connect(season = 2022, league_id = 22686, user_agent = "mikeyfili", rate_limit_number = 3, rate_limit_seconds = 6)`

Expected behavior
The above function should show that Patrick Mahomes had starts for Chicago Bears franchise in Weeks 13 and 14. However, this data is simply missing from the df, presumably because the Chicago Bears franchise did not have a weekly opponent (on account of Playoff bye) in weeks 13 or 14. They did, however, submit starting lineups with Mahomes as starter. This appears to be happening for all starters on such teams in this league for the weeks they didn't have weekly opponents. As far as I can tell, this problem is not occurring in 2021 MFL with the same league ID. Not sure why it's a "new issue" in 2022 leagues.

Session information
Please copy the output of ffscrapr::ffverse_sitrep() into the box below.

── System Info ────────────────────────────────────────────────────────────────── 
• R version 4.2.2 (2022-10-31 ucrt)   • Running under: Windows 10 x64 (build 22621) 
── ffverse Packages ─────────────────────────────────────────────────────────────
 • ffscrapr (1.4.8) 
── ffverse Options ────────────────────────────────────────────────────────────── 
No options set for ffscrapr 
── ffverse Dependencies ───────────────────────────────────────────────────────── 

• askpass    (1.1)     • glue      (1.6.2)  • rappdirs   (0.3.3)    • assertthat (0.2.1)   • httr      (1.4.4)  • ratelimitr (0.4.1)    • backports  (1.4.1)   • jsonlite  (1.8.4)  • rlang      (1.0.6)    • cachem     (1.0.6)   • lifecycle (1.0.3)  • stringi    (1.7.12)   • checkmate  (2.1.0)   • magrittr  (2.0.3)  • stringr    (1.5.0)    • cli        (3.4.1)   • memoise   (2.0.1)  • sys        (3.4.1)    • cpp11      (0.4.3)   • mime      (0.12)   • tibble     (3.1.8)    • curl       (4.3.3)   • nflreadr  (1.3.2)  • tidyr      (1.3.0)    • data.table (1.14.6)  • openssl   (2.0.5)  • tidyselect (1.2.0)    • dplyr      (1.1.0)   • pillar    (1.8.1)  • utf8       (1.2.3)    • fansi      (1.0.4)   • pkgconfig (2.0.3)  • vctrs      (0.5.2)    • fastmap    (1.1.0)   • purrr     (1.0.1)  • withr      (2.5.0)    • generics   (0.1.3)   • R6        (2.5.1)     

─────────────────────────────────────────────────────────────────────────────────

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@tanho63
Copy link
Member

tanho63 commented Feb 20, 2023

API changed to not return bye weeks as matchups.

ffscrapr::mfl_getendpoint(
   ffscrapr::mfl_connect(season = 2022, league_id = 22686), "weeklyResults", W = week, YEAR = year) |> 
   purrr::pluck("content", "weeklyResults") |> 
   str(max.level = 2)
# List of 3
# $ matchup  :List of 14
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
#  ..$ :List of 2
# $ franchise:List of 4
#  ..$ :List of 7
#  ..$ :List of 7
#  ..$ :List of 7
#  ..$ :List of 7
# $ week     : chr "13"

No timeline on when I'll be able to get to this but it seems solvable.

@TheMathNinja
Copy link
Contributor Author

And API changes don’t affect previous seasons?

@tanho63
Copy link
Member

tanho63 commented Feb 20, 2023

Apparently not.

@TheMathNinja
Copy link
Contributor Author

Should I be expecting more like weeks or months or years? 🤣

@TheMathNinja
Copy link
Contributor Author

MFL informed that this was actually because I didn't have the matchup listed as "Team X vs. Bye" for that week. Apparently that makes as difference on their end. But still this API is different than what they show starts-wise on their reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants