Skip to content

AttributeError when accessing dataset.queries_dict #286

@davidoterof

Description

@davidoterof

Describe the bug

A AttributeError exception is raised when trying to access dataset.queries_dict()

Affected dataset(s)

I have tried with "disks45/nocr/trec-robust-2004" and "msmarco-passage-v2/trec-dl-2022"

To Reproduce

import ir_datasets
dataset = ir_datasets.load("msmarco-passage-v2/trec-dl-2022")
dataset.queries_dict()

Expected behavior
It should return a dict with the queries

Additional context

I have taken a look at the code and think the problem is formats/base.py, line 188. It should be x.queries_iter() instead of x.iter_queries()

BaseQueries.EXTENSIONS['queries_dict'] = lambda x: {q.query_id: q for q in x.iter_queries()}

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