Skip to content

Conversation

@krivard
Copy link
Contributor

@krivard krivard commented Jun 10, 2020

  • Database schema change in ddl (Brian please double-check)
  • Supporting infra in acquisition
  • Extend all data insertion test cases to include toy issue and lag
  • Test that we can insert a new issue for an extant (source,signal,date,geo)

* Supporting infra in acquisition
* Extend all data insertion test cases to include toy issue and lag
* Test that we can insert a new issue for an extant (source,signal,date,geo)
@krivard krivard requested a review from korlaxxalrok June 10, 2020 21:11
Copy link
Member

@undefx undefx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, just leaving a drive-by review. hope that's ok.

this looks good to me, and it's cool to see that you all are expanding on this dataset with issue and lag. exciting! also, very happy to see tests being updated. keep up the good work.

please consider all my comments to be optional/advisory.

import glob
import os
import re
from datetime import date
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend ordering imports alphabetically within each import group, per convention (not 100% followed in all files, but in the majority i think)

# third party
import pandas

# delphi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency, this section is usually titled "first party"

sensible_day = 1 <= day <= 31

return nearby_year and valid_month and sensible_day
if not (nearby_year and valid_month and sensible_day): return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommend moving the return False to the line below, indented, because:

sensible_week = 1 <= week <= 53

return nearby_year and sensible_week
if not nearby_year and sensible_week: return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same advice)


@staticmethod
def find_csv_files(scan_dir, glob=glob):
def find_csv_files(scan_dir, issue=(date.today(),-1), glob=glob):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit, but i recommend using a linter like pycodestyle (but there are others ofc) to help spot style things. e.g. here it complains that there should be a space between , and -1. of course that's just someone's preference (pep8), but it helps to keep a consistent style for a large codebase.

The return value is a tuple of (path, details), where, if the path was
valid, details is a tuple of (source, signal, time_type, geo_type,
time_value) (otherwise None).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest updating this to reflect the new issue_value and lag_value values returned

Copy link
Contributor

@korlaxxalrok korlaxxalrok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@krivard krivard merged commit ab20e46 into cmu-delphi:feature/extend-covidcast-to-store-issue-date Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants