Skip to content

Commit 625c67c

Browse files
committed
Test Empire with NANs
There are some NANs getting passed along with Empire, this makes sure they are dropped out, so that processing can continue. xref gulfofmaine/NERACOOS_ERDDAP_K8S#1185
1 parent 6389bee commit 625c67c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

pipeline/s3_timeseries/tests/test_empire_met.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,30 @@ def test_monthly_asset(defs, dataset_config):
116116
snapshot = xr.load_dataset(snapshot_path)
117117

118118
xr.testing.assert_equal(ds, snapshot)
119+
120+
121+
def test_monthly_asset_with_nans(defs, dataset_config):
122+
monthly_ds = test_utils.get_asset_by_name(defs, "monthly_ds")
123+
context = dg.build_asset_context(partition_key="2025-10-01")
124+
125+
daily_df = {
126+
"2025-10-12": pd.read_csv(
127+
"tests/test_data/empire_met/2025-10-12.csv",
128+
parse_dates=["datetime"],
129+
),
130+
"2025-10-13": pd.read_csv(
131+
"tests/test_data/empire_met/2025-10-13.csv",
132+
parse_dates=["datetime"],
133+
),
134+
}
135+
136+
ds = monthly_ds(context, daily_df=daily_df)
137+
138+
assert isinstance(ds, xr.Dataset)
139+
snapshot_path = (
140+
"tests/test_data/empire_met/test_empire_met_monthly_asset_with_nans.nc"
141+
)
142+
# ds.to_netcdf(snapshot_path)
143+
snapshot = xr.load_dataset(snapshot_path)
144+
145+
xr.testing.assert_equal(ds, snapshot)

0 commit comments

Comments
 (0)