Skip to content

Commit ab7607f

Browse files
Apply suggestions from code review
Co-authored-by: melange396 <[email protected]>
1 parent decdd36 commit ab7607f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/acquisition/covidcast/covidcast_row.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class CovidcastRow:
4747
# Classvars.
4848
_db_row_ignore_fields: ClassVar = []
4949
_api_row_ignore_fields: ClassVar = ["id", "direction_updated_timestamp", "value_updated_timestamp"]
50-
_api_row_compatibility_ignore_fields: ClassVar = ["id", "direction_updated_timestamp", "value_updated_timestamp", "source", "time_type", "geo_type"]
50+
_api_row_compatibility_ignore_fields: ClassVar = _api_row_ignore_fields + ["source", "time_type", "geo_type"]
51+
5152
_pandas_dtypes: ClassVar = PANDAS_DTYPES
5253

5354
@staticmethod
@@ -57,20 +58,20 @@ def make_default_row(**kwargs) -> "CovidcastRow":
5758
"signal": "sig",
5859
"time_type": "day",
5960
"geo_type": "county",
60-
"time_value": 20200202,
61+
"time_value": 2020_02_02,
6162
"geo_value": "01234",
6263
"value": 10.0,
6364
"stderr": 10.0,
6465
"sample_size": 10.0,
6566
"missing_value": Nans.NOT_MISSING.value,
6667
"missing_stderr": Nans.NOT_MISSING.value,
6768
"missing_sample_size": Nans.NOT_MISSING.value,
68-
"issue": 20200202,
69+
"issue": 2020_02_02,
6970
"lag": 0,
7071
"id": None,
7172
"direction": None,
7273
"direction_updated_timestamp": 0,
73-
"value_updated_timestamp": 20200202,
74+
"value_updated_timestamp": 2020_02_02,
7475
}
7576
default_args.update(kwargs)
7677
return CovidcastRow(**default_args)

tests/acquisition/covidcast/test_covidcast_row.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def test_CovidcastRow(self):
6363

6464

6565
def test_covidcast_rows(self):
66-
covidcast_rows = covidcast_rows_from_args(signal=["sig_base"] * 5 + ["sig_other"] * 5, time_value=date_range("2021-05-01", "2021-05-05").to_list() * 2, value=list(range(10)))
66+
covidcast_rows = covidcast_rows_from_args(
67+
signal=["sig_base"] * 5 + ["sig_other"] * 5,
68+
time_value=date_range("2021-05-01", "2021-05-05").to_list() * 2,
69+
value=list(range(10)))
6770
df = covidcast_rows_as_api_row_df(covidcast_rows)
6871
expected_df = set_df_dtypes(DataFrame({
6972
"source": ["src"] * 10,

0 commit comments

Comments
 (0)