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

Error on wikipedia pageviews #969

Open
bmaz opened this issue May 14, 2024 · 1 comment
Open

Error on wikipedia pageviews #969

bmaz opened this issue May 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bmaz
Copy link
Collaborator

bmaz commented May 14, 2024

minet wikipedia pageviews pages_wikipedia -i test_wikipedia.csv --start-date 2012 --end-date 2024 > pages_test_wikipedia.csv
Collecting pageviews ━━━━━━━━━━━━ 0/2 pages ⠦ [  0%] in 510.50ms (?/s)                                                         
minet process was stopped because an error occurred!
Traceback (most recent call last):
  File "/home/bmazoyer/.pyenv/versions/minet/bin/minet", line 8, in <module>
    sys.exit(main())
  File "/home/bmazoyer/.pyenv/versions/3.8.2/envs/minet/lib/python3.8/site-packages/minet/cli/__main__.py", line 14, in main
    run("minet", __identifier__, MINET_COMMANDS)
  File "/home/bmazoyer/.pyenv/versions/3.8.2/envs/minet/lib/python3.8/site-packages/minet/cli/utils.py", line 49, in wrapper
    fn(*args, **kwargs)
  File "/home/bmazoyer/.pyenv/versions/3.8.2/envs/minet/lib/python3.8/site-packages/minet/cli/run.py", line 139, in run
    fn(cli_args)
  File "/home/bmazoyer/.pyenv/versions/3.8.2/envs/minet/lib/python3.8/site-packages/minet/cli/utils.py", line 468, in wrapper
    return action(cli_args, *args, **additional_kwargs, **kwargs)
  File "/home/bmazoyer/.pyenv/versions/3.8.2/envs/minet/lib/python3.8/site-packages/minet/cli/utils.py", line 478, in wrapper
    fn(cli_args, loading_bar=loading_bar, **kwargs)
  File "/home/bmazoyer/.pyenv/versions/3.8.2/envs/minet/lib/python3.8/site-packages/minet/cli/wikipedia/pageviews.py", line 35, in action
    for row, pageviews in client.pageviews(
  File "/home/bmazoyer/.pyenv/versions/3.8.2/envs/minet/lib/python3.8/site-packages/minet/wikipedia/wikimedia_rest_api_client.py", line 125, in pageviews
    for item in response.json()["items"]:
KeyError: 'items'

@Yomguithereal Yomguithereal added the bug Something isn't working label May 14, 2024
@Yomguithereal
Copy link
Member

The API returns a 400 for this because the date format is incorrect. We must add some validation, or some sugar, and better document the command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants