digital-science / dimcli

Python client and CLI for scientometrics and research analytics using the Dimensions API.

Home Page:https://digital-science.github.io/dimcli/getting-started.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loop queries should continue after errors

lambdamusic opened this issue · comments

eg

search publications
    where research_orgs.id = "grid.170205.1"
    and year in [2011:2012]
    return publications[id+doi+title+times_cited+recent_citations+field_citation_ratio+category_for+authors]

# leads to

1 EvaluationError found
Query is too long or complex. Please see https://docs.dimensions.ai/dsl/faq.html for more information. [code: 2]

If that's within a loop query, we should continue the iteration after notifying the user.

https://github.com/digital-science/dimcli/blob/master/dimcli/core/api.py#L184

Cannot be done easily cause the recursion has no state about tot numbers of records available (= iterations left), unless it gets it from the payload.

Also not clear why this would be useful as one would get an incomplete dataset.

I've added a more informative error message instead ie suggesting to use the limit keyword.

V 0.63