Skip to content

Commit

Permalink
Fixed unit tests to enforce proper 'where' keys for value selectors a…
Browse files Browse the repository at this point in the history
…nd added a TODO to the disk data_retriever to inform that the 'date_parser' logic needs to be replaced
  • Loading branch information
christophertubbs committed Jul 25, 2023
1 parent 49748b9 commit f8c025c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ def retrieve(self, *args, **kwargs) -> pandas.DataFrame:
else:
provided_parameters[option] = value

# TODO: 'date_parser' is deprecated in pandas 2.0. In the future, find a way to bring in date columns
# as objects then call 'to_datetime' on the column after loading.
# You can probably just check for any 'parse_dates' parameters in 'provided_parameters
if 'date_parser' not in provided_parameters:
provided_parameters['date_parser'] = util.parse_non_naive_dates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def setUp(self) -> None:
"prediction_field_name": "prediction_location",
"field": specification.ValueSelector(
name="z",
where='one/two/three'
where='column'
),
"observation_field_name": "observation_field",
"properties": {
Expand Down Expand Up @@ -219,7 +219,7 @@ def setUp(self) -> None:
},
"field": {
"name": "ham",
"where": "sandwich"
"where": "filename"
}
}
)
Expand All @@ -238,7 +238,7 @@ def setUp(self) -> None:
},
"field": specification.ValueSelector(
name="cobb",
where="salad"
where="key"
),
"entity_path": "",
"prediction_field_name": "prediction_location",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def setUp(self) -> None:
),
specification.ValueSelector(
name="site_no",
where="value:*/site_no",
where="value",
path="/path/to/value",
associated_fields=[
specification.AssociatedField(
Expand Down Expand Up @@ -216,13 +216,13 @@ def setUp(self) -> None:
"value_selectors": [
specification.ValueSelector(
name="example",
where="kezfdgy",
where="key",
origin="path/tofdz/array",
prop1=55
),
specification.ValueSelector(
name="otherExample",
where="filzdfgename",
where="filename",
path="zfdunno",
datatype="datetime"
)
Expand Down Expand Up @@ -269,7 +269,7 @@ def setUp(self) -> None:
],
"value_selectors": [
specification.ValueSelector(
where="filcxdfbgename",
where="filename",
path="dundxfno",
name="sdhfsdhfh"
)
Expand Down Expand Up @@ -336,7 +336,7 @@ def setUp(self) -> None:
),
{
"name": "dsfsf",
"where": "value:*/site_no",
"where": "value",
"path": "/path/to/value",
"associated_fields": [
{
Expand Down Expand Up @@ -408,13 +408,13 @@ def setUp(self) -> None:
),
"value_selectors": [
specification.ValueSelector(
where="kezfdgy",
where="key",
origin="path/tofdz/array",
prop1=55,
name="nameOfValue"
),
dict(
where="filzdfgename",
where="value",
path="zfdunno",
datatype="datetime",
name="nameOfValue"
Expand Down Expand Up @@ -478,7 +478,7 @@ def setUp(self) -> None:
"value_selectors": [
dict(
name="sdfhsdhfoi",
where="filcxdfbgename",
where="filename",
path="dundxfno"
)
],
Expand Down Expand Up @@ -525,7 +525,7 @@ def setUp(self) -> None:
),
dict(
name="asdads",
where="value:*/site_no",
where="value",
path="/path/to/value",
associated_fields=[
dict(
Expand Down Expand Up @@ -628,13 +628,13 @@ def setUp(self) -> None:
"value_selectors": [
dict(
name="asdasd",
where="kezfdgy",
where="key",
origin="path/tofdz/array",
prop1=55
),
dict(
name="sdfsdf",
where="filzdfgename",
where="filename",
path="zfdunno",
datatype="datetime"
)
Expand Down Expand Up @@ -685,7 +685,7 @@ def setUp(self) -> None:
"value_selectors": [
dict(
name="sdfdsf",
where="filcxdfbgename",
where="filename",
path="dundxfno"
)
],
Expand Down

0 comments on commit f8c025c

Please sign in to comment.