Skip to content

timelines query argument consistency #89

@pdobsan

Description

@pdobsan

It is great that the /locations query can be augmented with a timelines=true parameter. It defaults to false, quite rightly, otherwise the server can easily be overwhelmed by unnecessary load. It is reasonable to assume that a significant part of requests are interested only in the latest numbers.

However the API has a slight inconsistency when we compare '/locations' and '/locations/id' requests. The '/locations/id' defaults to providing the time series data, what is more one cannot even disable this by providing a timelines=false parameter, that would be ignored by the current code.

That is inefficient. If I want to get only the latest numbers for, say, Washington state US then I either need to download all locations from US and throw away all but Washington or ask for /locations/<washington_id> and throw away the time series data.

I think that serving these two types of queries should be consistent that is both should default to serving latest numbers only, and time series data should be requested explicitly by using timelines=true parameter.

The change in code would be very minor, I believe. Also I would not consider this change /v2/ breaking, rather just fixing an oversight in order to prevent wasting server resources.

These considerations are somewhat related to the performance issue mentioned in #74

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions