Skip to content

Handle empty FanDuel projection responses - #168

Open
TheMathNinja wants to merge 1 commit into
FantasyFootballAnalytics:masterfrom
TheMathNinja:fix-fanduel-empty-projections
Open

Handle empty FanDuel projection responses#168
TheMathNinja wants to merge 1 commit into
FantasyFootballAnalytics:masterfrom
TheMathNinja:fix-fanduel-empty-projections

Conversation

@TheMathNinja

Copy link
Copy Markdown

Summary

  • skip FanDuel position groups when GraphQL returns an empty projection list
  • return an empty, season/week-tagged result with a clear message when no groups are available
  • fix the FanDuel scraper's season default guard (season, not week)

Diagnosis

FanDuel's current projections page and its GetProjections GraphQL operation both report no NFL projections during the offseason. The scraper converted that empty response to a zero-column tibble, then mutate(pos = ...) resolved pos to the six-element function argument and raised a misleading dplyr size error.

This keeps the existing endpoint (which is still used by FanDuel's current page) and makes the legitimate empty-response state safe. It will continue processing if only some position groups are empty.

Verification

  • Installed the package from this branch successfully.
  • Ran scrape_fanduel(pos = c("QB", "RB", "WR", "TE", "K", "DST"), season = 2026, week = 0) against the live endpoint.
  • Verified it returns an empty list with season = 2026 and week = 0 attributes and the message FanDuel returned no projections. Please check back later.
  • R CMD check reaches package metadata checks; a complete check is blocked by missing suggested packages (knitr, nflfastR, rmarkdown) and pre-existing repository/environment check issues.

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

Successfully merging this pull request may close these issues.

1 participant