Code Monkey home page Code Monkey logo

kawhi's Issues

Test suite failure

Not sure what triggered this failure:

> /tmp/stackage-build9/kawhi-0.2.0$ dist/build/tests/tests
Data.NBA.Stats
  show (StatsResponseDecodeFailure message) == "StatsError (StatsResponseDecodeFailure message)":           OK (0.02s)
    206 tests completed
  show (SplitNameNotFound message) == "StatsError (SplitNameNotFound message)":                             OK (0.04s)
    206 tests completed
  show (SplitKeyNotFound message) == "StatsError (SplitKeyNotFound message)":                               OK (0.02s)
    206 tests completed
  show (SplitColumnNameNotFound message) == "StatsError (SplitColumnNameNotFound message)":                 OK (0.03s)
    206 tests completed
  show (SplitRowCardinalityInconsistent message) == "StatsError (SplitRowCardinalityInconsistent message)": OK (0.01s)
    206 tests completed
  show (SplitRowParseFailure message) == "StatsError (SplitRowParseFailure message)":                       OK (0.02s)
    206 tests completed
  Get stat -> Success:                                                                                      OK
  Get stats -> Success:                                                                                     OK
  Get stat -> SplitRowCardinalityInconsistent:                                                              OK
  Get stat -> SplitKeyNotFound (no rows):                                                                   OK
  Get stat -> SplitKeyNotFound (no key value):                                                              OK
  Get stat -> SplitKeyNotFound (JSON parse error for key value):                                            OK
  Get stat -> SplitNameNotFound:                                                                            OK
  Get stat -> SplitColumnNameNotFound:                                                                      OK
  Get stat -> SplitRowParseFailure (type mismatch):                                                         FAIL
    expected: StatsError (SplitRowParseFailure failed to parse field A: expected Integral, encountered String)
     but got: StatsError (SplitRowParseFailure expected Integer, encountered String)
  Get stat -> SplitRowParseFailure (missing field):                                                         OK
  Get stat -> StatsResponseDecodeFailure (for Stats):                                                       OK
  parseJSON invalid :: Parser Split -> Error:                                                               OK

1 out of 18 tests failed (0.11s)

Scoreboard still fails

Hey, sorry to bother you (again 😆) but I still have a problem.

The example now works fine for me, but the way I was actually trying to use kawhi was to get the stats.nba.com scoreboard endpoint, which still fails for me using this package. I think it might be because the request has no Referer header, as that seems to be required.

I totally get that things like this probably change all the time (as it's a very unstable API). Have you considered exporting a pure version of getSplitRows so that users of the library can make the request themselves?

fails to build with aeson-2.0

kawhi                     > /tmp/stack-930e93223b6b89bd/kawhi-0.3.0/library/Data/NBA/Stats.hs:303:63: error:
kawhi                     >     • Couldn't match type ‘Text.Text’ with ‘Aeson.Key’
kawhi                     >       Expected: [Aeson.Pair]
kawhi                     >         Actual: [(SplitColumn, Aeson.Value)]
kawhi                     >     • In the first argument of ‘Aeson.object’, namely
kawhi                     >         ‘(zip columns row)’
kawhi                     >       In the second argument of ‘($)’, namely
kawhi                     >         ‘Aeson.object (zip columns row)’
kawhi                     >       In the expression:
kawhi                     >         Aeson.parse Aeson.parseJSON $ Aeson.object (zip columns row)
kawhi                     >     |
kawhi                     > 303 |         then case Aeson.parse Aeson.parseJSON $ Aeson.object (zip columns row) of
kawhi                     >     |                                                               ^^^^^^^^^^^^^^^

Example fails with ResponseTimeout

When I run the example, this is what I see:

~/kawhi/example$ stack exec kawhi-example
kawhi-example: HttpExceptionRequest Request {
  host                 = "stats.nba.com"
  port                 = 80
  secure               = False
  requestHeaders       = []
  path                 = "/stats/teamdashboardbygeneralsplits"
  queryString          = "?Conference&DateFrom&DateTo&Division&GameScope&GameSegment&LastNGames=0&LeagueID=00&Location&MeasureType=Advanced&Month=0&OpponentTeamID=0&Outcome&PaceAdjust=N&PerMode=PerGame&Period=0&PlayerExperience&PlayerPosition&PlusMinus=N&PORound=0&Rank=N&Season=2015-16&SeasonSegment&SeasonType=Regular%20Season&ShotClockRange&StarterBench&TeamID=1610612759&VsConference&VsDivision"
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 ResponseTimeout

Any idea what could be causing this?

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.