ffverse / ffscrapr

R API Client for Fantasy Football League Platforms
https://ffscrapr.ffverse.com
Other
82 stars 21 forks source link

ff_starters error #379

Closed albtree closed 2 years ago

albtree commented 2 years ago

Describe the bug ff_starters bringing up left_join error for franchise_id

Reprex: library(tidyverse) library(dplyr) library(ffscrapr) library(nflverse) library(ffopportunity) leo <- sleeper_connect(season = 2022, league_id = "784699671670104064") leo_starters <- ff_starters(leo, week = 1) Error in dplyr::left_join(): ! Join columns must be present in data. ✖ Problem with franchise_id. Run rlang::last_error() to see where the error occurred.

rlang::last_trace() <error/rlang_error> Error in dplyr::left_join(): ! Join columns must be present in data. ✖ Problem with franchise_id.

Backtrace: ▆

  1. ├─ffscrapr::ff_starters(leo, week = 1)
  2. ├─ffscrapr:::ff_starters.sleeper_conn(leo, week = 1)
  3. │ └─... %>% ...
  4. ├─dplyr::select(...)
  5. ├─dplyr::left_join(., players_endpoint, by = "player_id")
  6. ├─dplyr::left_join(., franchises_endpoint, by = "franchise_id")
  7. └─dplyr:::left_join.data.frame(., franchises_endpoint, by = "franchise_id")
  8. └─dplyr:::join_mutate(...)
  9. └─dplyr:::join_cols(...)
  10. └─dplyr:::standardise_join_by(...)
  11. └─dplyr:::check_join_vars(by$x, x_names, error_call = error_call)
  12. └─rlang::abort(bullets, call = error_call)
 # Please include the code used for the connection object from `ff_connect()`

Expected behavior ff_starters to pull fantasy football starters for week 1 year 2022 Also tried 2021 to see if an issue with week 1 year 2022 not being fully completed yet but same error

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

ffscrapr::ffverse_sitrep() ℹ You've asked for the package ffpros which is not installed. It is skipped. ── System Info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── • R version 4.2.1 (2022-06-23 ucrt) • Running under: Windows 10 x64 (build 19044) ── ffverse Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── • ffscrapr (1.4.7.10) • ffsimulator (1.2.1) • ffopportunity (0.1.0.04)
── ffverse Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── No options set for ffscrapr, ffsimulator, and ffopportunity ── ffverse Dependencies ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────── • askpass (1.1) • glue (1.6.2) • ratelimitr (0.4.1)
• assertthat (0.2.1) • httr (1.4.4) • Rglpk (0.6-4)
• backports (1.4.1) • jsonlite (1.8.0) • rlang (1.0.5)
• cachem (1.0.6) • lifecycle (1.0.1) • slam (0.1-50)
• checkmate (2.1.0) • magrittr (2.0.3) • stringi (1.7.6)
• cli (3.4.0) • memoise (2.0.1) • stringr (1.4.0)
• cpp11 (0.4.2) • mime (0.12) • sys (3.4)
• curl (4.3.2) • nflreadr (1.3.0) • tibble (3.1.7)
• data.table (1.14.2) • openssl (2.0.0) • tidyr (1.2.0)
• dplyr (1.0.10) • pillar (1.7.0) • tidyselect (1.1.2)
• ellipsis (0.3.2) • pkgconfig (2.0.3) • tidytable (0.8.1)
• fansi (1.0.3) • purrr (0.3.4) • utf8 (1.2.2)
• fastmap (1.1.0) • R6 (2.5.1) • vctrs (0.4.1)
• generics (0.1.3) • rappdirs (0.3.3)
──────────────────────────────────────────────────

tanho63 commented 2 years ago

@albtree should be fixed in latest devel version, which you can install via remotes::install_github("ffverse/ffscrapr")

albtree commented 2 years ago

You're far too quick. Thanks Tan!

tanho63 commented 2 years ago

Claiming all the easy wins where I can haha, this is the extent of the change https://github.com/ffverse/ffscrapr/pull/380/files