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

Fix sleeper draftpicks #361

Merged
merged 2 commits into from
Dec 12, 2022
Merged

Fix sleeper draftpicks #361

merged 2 commits into from
Dec 12, 2022

Conversation

joeflan
Copy link
Contributor

@joeflan joeflan commented Jul 26, 2022

Fixes #352

ff_draftpicks is returning an error when trying to load sleeper data. It seems the current_picks object was removed

@joeflan joeflan marked this pull request as ready for review July 27, 2022 00:40
@joeflan
Copy link
Contributor Author

joeflan commented Jul 27, 2022

I've done some local testing and it's all working now.

ff_draftpicks returns a data frame now for the current upcoming draft. I've also tested the issue in #352 and can't reproduce. What's likely happening is their API was updated to the new league year and it is no longer an issue.

@tanho63
Copy link
Member

tanho63 commented Jul 27, 2022

Checks are being a pain in the butt. Are you good to use your branch version til I can look at it properly?

Anyone else looking at this, you can install with remotes::install_github('joeflan/ffscrapr@sleeper-draftpicks') to get the latest from this branch

@joeflan
Copy link
Contributor Author

joeflan commented Jul 27, 2022

Yeah I have no problem using my branch as the ffscraper package locally. Don't sweat it

@tanho63
Copy link
Member

tanho63 commented Aug 10, 2022

Okay, reviewing a little more closely now that I'm back.

ff_draftpicks is designed to return the following:

  • for the current-season, it should return the numeric-indexed picks (i.e. 1.01, 2.12, 3.01 etc) that have not yet been drafted (and should incorporate trades)
  • for future seasons, it should return future picks by round

Sleeper used to make the former available but now only makes it available if the league is actively drafting - otherwise it only makes the traded picks available and (sometimes) a draft order.

To recreate the previous functionality, I envision sleeper_draftpicks to need to do:

  • check status of draft and whether a draft order is available.
  • if draft order is not avail, treat as future picks
  • if draft order is avail, build pick order from draft order and draft type then apply pick trades, if any.
  • then run ff_draft and see if there's any selected picks to remove
  • then bind onto the existing future drafts

@tanho63
Copy link
Member

tanho63 commented Aug 10, 2022

I'm trying to button up all these things this week before I get going on newjob so I should have some time to look at this today/tomorrow.

@tanho63
Copy link
Member

tanho63 commented Dec 12, 2022

Going to accept this PR so that ff_draftpicks is not entirely broken and open a new issue (#386) for the optimal behaviour.

@tanho63 tanho63 merged commit 6a14ef6 into ffverse:main Dec 12, 2022
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.

ff_draftpicks returning Error
2 participants