Skip to content

Commit

Permalink
Merge pull request #72 from ecmwf/fix/pandas211
Browse files Browse the repository at this point in the history
Fix/pandas211
  • Loading branch information
iainrussell authored Oct 18, 2023
2 parents 20b2cb1 + 09f8583 commit b4cee9c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/test_40_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,14 @@ def test_ens_compressed() -> None:


def test_sat_compressed_1() -> None:
def timestamp(s: str) -> T.Any:
ts = pd.Timestamp(s)
try:
ts = ts.as_unit("ns")
except:
pass
return ts

columns = [
"data_datetime",
"latitude",
Expand All @@ -745,7 +753,7 @@ def test_sat_compressed_1() -> None:
]

expected_first_row = {
"data_datetime": pd.Timestamp("2015-08-21 01:59:05"),
"data_datetime": timestamp("2015-08-21 01:59:05"),
"latitude": -44.83389,
"longitude": 171.1635,
"nonCoordinateLatitude": -44.82399,
Expand All @@ -755,7 +763,7 @@ def test_sat_compressed_1() -> None:
}

expected_second_row = {
"data_datetime": pd.Timestamp("2015-08-21 01:59:05"),
"data_datetime": timestamp("2015-08-21 01:59:05"),
"latitude": -44.83389,
"longitude": 171.1635,
"nonCoordinateLatitude": -44.82399,
Expand All @@ -765,7 +773,7 @@ def test_sat_compressed_1() -> None:
}

expected_12_row = {
"data_datetime": pd.Timestamp("2015-08-21 01:59:05"),
"data_datetime": timestamp("2015-08-21 01:59:05"),
"latitude": -44.83389,
"longitude": 171.1635,
"nonCoordinateLatitude": -44.82399,
Expand All @@ -775,7 +783,7 @@ def test_sat_compressed_1() -> None:
}

expected_13_row = {
"data_datetime": pd.Timestamp("2015-08-21 01:59:06"),
"data_datetime": timestamp("2015-08-21 01:59:06"),
"latitude": -44.77121,
"longitude": 171.1515,
"nonCoordinateLatitude": -44.76132,
Expand Down

0 comments on commit b4cee9c

Please sign in to comment.