Coder Social home page Coder Social logo

Comments (4)

murrayjw avatar murrayjw commented on June 15, 2024 3

I was having the same problem and had a quick look at the code. Looks like the problem is coming from a new default argument (params = list()) that was added to the .nba_headers() function. That function uses httr::GET to request the data from the API. The params argument is passed to httr::GET in the query argument but it is empty for the nba_leaguegamelog function. If you remove the query argument the data is returned as it was before.

So if this:

res <- httr::RETRY("GET", url, query = params, httr::add_headers(.headers = headers))

is changed to this:

if(length(params) == 0) {
   res <- httr::RETRY("GET", url, httr::add_headers(.headers = headers))
} else {
    res <- httr::RETRY("GET", url, query = params, httr::add_headers(.headers = headers))
}

in the .nba_headers() function, everything works. The params argument gets used elsewhere (e.g. hoopR::nba_scoreboard. so you need some logic to deal with the case where params are empty

from hoopr.

schmid07 avatar schmid07 commented on June 15, 2024

It looks like when I ran on Windows (where it was working), I was using version 1.5.0 of hoopR. When I switched to 1.8.0, I got the same error message as when running on Mac. And when I switched back to 1.5.0 on the Mac, the function worked. So it seems like the function works in v. 1.5.0, but was having some issues with 1.7.0 and then also when I updated to 1.8.0.

Thanks.

from hoopr.

saiemgilani avatar saiemgilani commented on June 15, 2024

You're a lifesaver, thanks

from hoopr.

murrayjw avatar murrayjw commented on June 15, 2024

No problem! Anytime

from hoopr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.