Skip to content

Be more defensive in earliest_issue and latest_issue, export them #282

@capnrefsmmat

Description

@capnrefsmmat

These are not exported, but could be useful to users, particularly those working with multiple issue dates.

Before we do so, however, we should address Ryan's comments:

  • This will return a covidcast_signal data frame with scrambled rows. Would it be worth reordering? This doesn't affect any of our downstream uses like plotting or correlations, but may confuse a user if they call latest_issue() directly.

  • As far as I understand, latest_issue() doesn't check the class? So it could in principle be applied to a covidcast_signal_long data frame? And in this case it wouldn't return the right result, since you're masking by geo_value and time_value in the call to dplyr::distinct(). Thus I would either check the class in latest_issue() ... or include data_source and signal as masking variables.

For our current uses, neither of these is a problem, but we should fix them before exporting.

I'm tempted to say that reordering the rows is fine -- at least if we document the return order, so users aren't too surprised -- but the second point is definitely a footgun we should fix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions