-
Notifications
You must be signed in to change notification settings - Fork 6
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
Simplest example in README doesn't work #72
Labels
bug
Something isn't working
Comments
I'll get this cleaned up today. I must not have enough test coverage when I was refactoring. Thanks for finding this. |
This seems to work on my console, ver 3.10 and 3.12, but I can replicate this error in google collab. Which is 3.10. So the search continues. |
this is fixed in ! pip install nhl-api-py
from nhlpy.api.query.builder import QueryBuilder, QueryContext
from nhlpy.nhl_client import NHLClient
from nhlpy.api.query.filters.draft import DraftQuery
from nhlpy.api.query.filters.season import SeasonQuery
from nhlpy.api.query.filters.game_type import GameTypeQuery
from nhlpy.api.query.filters.position import PositionQuery, PositionTypes
client = NHLClient(verbose=True)
filters = [
GameTypeQuery(game_type="2"),
DraftQuery(year="2020", draft_round="2"),
SeasonQuery(season_start="20202021", season_end="20232024"),
PositionQuery(position=PositionTypes.ALL_FORWARDS)
]
query_builder = QueryBuilder()
query_context: QueryContext = query_builder.build(filters=filters)
data = client.stats.skater_stats_with_query_context(
report_type='summary',
query_context=query_context,
aggregate=True
)
data
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Ran the sample code on the home page in Python 3.11 on MacOS and got this error:
The text was updated successfully, but these errors were encountered: