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_scoring() not working for MFL league with thresholdPoints #413

Open
TheMathNinja opened this issue Sep 5, 2023 · 10 comments
Open

ff_scoring() not working for MFL league with thresholdPoints #413

TheMathNinja opened this issue Sep 5, 2023 · 10 comments

Comments

@TheMathNinja
Copy link
Contributor

Describe the bug
Running ff_playerscores() now returns an error for my MFL league.

Reprex

library(ffscrapr)
library(nflverse)
library(tidyverse)

FAFL22 <- mfl_connect(season = 2022, league_id = 22686, rate_limit_number = 3, rate_limit_seconds = 6)

ffscrapr::ff_playerscores(FAFL22,
                          season = 2022,
                          week = 1:17)

 # Please include the code used for the connection object from `ff_connect()`

Expected behavior
I expect it to return a df, but I'm getting an error:
Error in dplyr::mutate():
ℹ In argument: rule = purrr::map(.data$rule, parse_rule).
Caused by error in purrr::map():
ℹ In index: 10.
Caused by error in mutate():
ℹ In argument: thresholdPoints = (structure(function (..., .x = ..1, .y = ..2, . = ..1) ....
Caused by error:
! thresholdPoints must be size 12 or 1, not 5.

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

Warning: unable to access index for repository https://packagemanager.posit.co/cran/latest/src/contrib:
  cannot open URL 'https://packagemanager.posit.co/cran/latest/src/contrib/PACKAGES'
Warning: unable to access index for repository https://cloud.r-project.org/src/contrib:
  cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
── System Info ────────────────────────────────────────────────────────────
• R version 4.3.1 (2023-06-16 ucrt) • Running under: Windows 11 x64 (build 22621)
── Package Status ─────────────────────────────────────────────────────────
   package installed  cran      dev behind
1 ffscrapr  1.4.8.11 1.4.8 1.4.8.11       
── Package Options ────────────────────────────────────────────────────────
• No options set for above packages
── Package Dependencies ───────────────────────────────────────────────────
• askpass    (1.1)     • jsonlite   (1.8.7)   • stringr    (1.5.0)  
• assertthat (0.2.1)   • lifecycle  (1.0.3)   • sys        (3.4.2)  
• backports  (1.4.1)   • magrittr   (2.0.3)   • tibble     (3.2.1)  
• cachem     (1.0.8)   • memoise    (2.0.1)   • tidyr      (1.3.0)  
• checkmate  (2.2.0)   • mime       (0.12)    • tidyselect (1.2.0)  
• cli        (3.6.1)   • nflreadr   (1.4.0)   • utf8       (1.2.3)  
• cpp11      (0.4.6)   • openssl    (2.1.0)   • vctrs      (0.6.3)  
• curl       (5.0.2)   • pillar     (1.9.0)   • withr      (2.5.0)  
• data.table (1.14.8)  • pkgconfig  (2.0.3)   • graphics   (4.3.1)  
• dplyr      (1.1.2)   • purrr      (1.0.2)   • grDevices  (4.3.1)  
• fansi      (1.0.4)   • R6         (2.5.1)   • methods    (4.3.1)  
• fastmap    (1.1.1)   • rappdirs   (0.3.3)   • stats      (4.3.1)  
• generics   (0.1.3)   • ratelimitr (0.4.1)   • tools      (4.3.1)  
• glue       (1.6.2)   • rlang      (1.1.1)   • utils      (4.3.1)  
• httr       (1.4.7)   • stringi    (1.7.12)    
── Not Installed ──────────────────────────────────────────────────────────
• ffsimulatorffprosffopportunity  
───────────────────────────────────────────────────────────────────────────

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

Additional context
Add any other context about the problem here.

@tanho63

This comment was marked as outdated.

@tanho63

This comment was marked as outdated.

@tanho63 tanho63 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2023
@tanho63 tanho63 reopened this Sep 10, 2023
@tanho63
Copy link
Member

tanho63 commented Sep 10, 2023

Looks like different issue, so reopening this again. Is thresholdPoints a new addition to the scoring for this year?

@tanho63 tanho63 changed the title ff_playerscores() broke yesterday ff_scoring() not working for MFL league with thresholdPoints Sep 10, 2023
@TheMathNinja
Copy link
Contributor Author

Thanks so much for working on this @tanho63!

@TheMathNinja
Copy link
Contributor Author

Any updates on this one? Is it pretty complex?

@tanho63
Copy link
Member

tanho63 commented Oct 25, 2023

Yeah, somewhat complex. Limiting factor is lack developer time though

@rlynch91
Copy link

rlynch91 commented Apr 7, 2024

Hey all,
I’m picking this up again with @TheMathNinja.
Looks like one workaround is just to use the prod branch (1.4.8) instead of the dev branch head (1.4.8.17); on prod, ff_playerscores() (the original use case) appears to run just fine, dev reproduces the original error.
Any idea which commit on the dev branch could cause this divergence?
I’m a far cry from an R developer, but happy to help hack in a fix where I can.

@TheMathNinja
Copy link
Contributor Author

@rlynch91 Any chance you could get to the bottom of this thing this month?

@rlynch91
Copy link

Hi all, I haven’t dug too much into this issue since last commenting back in April re my workaround.
To summarize for all: @TheMathNinja and I have been running with the prod branch (1.4.8), and everything has been working fine since on MFL.
It was the dev branch head at the time (1.4.8.17) that had a broken ff_playerscores() on MFL.
This has been a fine workflow for us in the short term, but it would be nice to get synced back up with head.
@tanho63, any idea which commit in between those could have caused this issue we’re seeing on MFL?
I haven’t been able to pinpoint it in the limited time I’ve had to look at this, but the hope would be that there’s a low-hanging hack there to leverage the compatibility of prod 1.4.8.

@tanho63
Copy link
Member

tanho63 commented Aug 18, 2024

Unsure, you'd need to use git bisect a bunch probably. My guess it's this commit for new dplyr compatibility: b2dc63a

This can't be fixed via a reversion, so it'll need to be updated to handle the new dplyr rectangling output.

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

3 participants