Skip to content

KeyError: 'stats' #16

@eulereadgbe

Description

@eulereadgbe

@alanorth, when I tried running python -m dspace_statistics_api.indexer, I received this error:

  File "C:\Users\euler\.pyenv\pyenv-win\versions\3.7.9\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\euler\.pyenv\pyenv-win\versions\3.7.9\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\dspace-statistics-api\dspace_statistics_api\indexer.py", line 223, in <module>
    index_views("items", "id")
  File "D:\dspace-statistics-api\dspace_statistics_api\indexer.py", line 56, in index_views
    results_totalNumFacets = res.json()["stats"]["stats_fields"][facetField][
KeyError: 'stats'

I tried this in a repository with no shards, and another with sharded statistics. Both repositories are using DSpace version 6.3 running on Windows 2019 Server and tested with Python versions 3.7.9, 3.9.1, and 3.9.10. What could I be missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions