Skip to content

covidcast endpoint - as_of field fails silently when given a range of dates #1152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dshemetov opened this issue Apr 27, 2023 · 1 comment · Fixed by #1300
Closed

covidcast endpoint - as_of field fails silently when given a range of dates #1152

dshemetov opened this issue Apr 27, 2023 · 1 comment · Fixed by #1300
Assignees

Comments

@dshemetov
Copy link
Contributor

dshemetov commented Apr 27, 2023

@dmytrotsko
Copy link
Contributor

This happens, because time range like this -> 20230101-20230102 is a "valid range".
This function is used to parse it:

    # parses a given string in format YYYYMMDD or YYYY-MM-DD to a number in the form YYYYMMDD
    try:
        if s == "*":
            return s
        else:
            return int(s.replace("-", ""))
    except ValueError:
        raise ValidationFailedException(f"not a valid date: {s}")

Which means that 20230101-20230102 is parsed to 2023010120230102.

@dmytrotsko dmytrotsko linked a pull request Oct 6, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants