Skip to content
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

update min year for acquisition to 2017 #1582

Closed
aysim319 opened this issue Jan 26, 2025 · 0 comments
Closed

update min year for acquisition to 2017 #1582

aysim319 opened this issue Jan 26, 2025 · 0 comments
Assignees
Labels
acquisition changes acquisition logic

Comments

@aysim319
Copy link
Contributor

google symptoms later introduced issue dates preceding the current min_year for acquisition
when attempting to patch data, patch failed with the message

{"detail": 20171028, "file": "/common/covidcast/batch_issue_upload/issue_20171028", "event": "invalid issue directory day", "logger": "find_issue_specific_csv_files", "level": "warning", "timestamp": "2025-01-25T05:47:04.151974Z"}
{"detail": 20171029, "file": "/common/covidcast/batch_issue_upload/issue_20171029", "event": "invalid issue directory day", "logger": "find_issue_specific_csv_files", "level": "warning", "timestamp": "2025-01-25T05:47:04.152044Z"}
{"detail": 20171030, "file": "/common/covidcast/batch_issue_upload/issue_20171030", "event": "invalid issue directory day", "logger": "find_issue_specific_csv_files", "level": "warning", "timestamp": "2025-01-25T05:47:04.152130Z"}
{"detail": 20171031, "file": "/common/covidcast/batch_issue_upload/issue_20171031", "event": "invalid issue directory day", "logger": "find_issue_specific_csv_files", "level": "warning", "timestamp": "2025-01-25T05:47:04.152198Z"}

  MIN_YEAR = 2019

 def is_sane_day(value):
    """Return whether `value` is a sane (maybe not valid) YYYYMMDD date.

    Truthy return is is a datetime.date object representing `value`."""

    year, month, day = value // 10000, (value % 10000) // 100, value % 100

    nearby_year = CsvImporter.MIN_YEAR <= year <= CsvImporter.MAX_YEAR
    valid_month = 1 <= month <= 12
    sensible_day = 1 <= day <= 31

    if not (nearby_year and valid_month and sensible_day):
      return False
    return date(year=year,month=month,day=day)

blocks cmu-delphi/covidcast-indicators#2107

@aysim319 aysim319 added the acquisition changes acquisition logic label Jan 26, 2025
@aysim319 aysim319 changed the title update min year to 2017 update min year for acquisition to 2017 Jan 26, 2025
@aysim319 aysim319 self-assigned this Jan 27, 2025
@aysim319 aysim319 mentioned this issue Jan 27, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acquisition changes acquisition logic
Projects
None yet
Development

No branches or pull requests

1 participant