diff --git a/src/nwp_consumer/internal/repositories/model_repositories/noaa_s3.py b/src/nwp_consumer/internal/repositories/model_repositories/noaa_s3.py index e8c7a42..0e087f3 100644 --- a/src/nwp_consumer/internal/repositories/model_repositories/noaa_s3.py +++ b/src/nwp_consumer/internal/repositories/model_repositories/noaa_s3.py @@ -283,6 +283,13 @@ def _convert(path: pathlib.Path) -> ResultE[list[xr.DataArray]]: ], ) + if len(processed_das) == 0: + return Failure(ValueError( + f"The file at '{path}' does not contain any variables of interest. " + "Ensure the conversion pipeline is not accidentally dropping wanted variables, ", + "and that the file contains variables of interest.", + )) + return Success(processed_das) @staticmethod diff --git a/src/nwp_consumer/internal/repositories/model_repositories/test_HRES-GFS_aptmp.grib b/src/nwp_consumer/internal/repositories/model_repositories/test_HRES-GFS_aptmp.grib new file mode 100644 index 0000000..932e887 Binary files /dev/null and b/src/nwp_consumer/internal/repositories/model_repositories/test_HRES-GFS_aptmp.grib differ diff --git a/src/nwp_consumer/internal/repositories/model_repositories/test_noaa_s3.py b/src/nwp_consumer/internal/repositories/model_repositories/test_noaa_s3.py index 9782f64..8da0c1d 100644 --- a/src/nwp_consumer/internal/repositories/model_repositories/test_noaa_s3.py +++ b/src/nwp_consumer/internal/repositories/model_repositories/test_noaa_s3.py @@ -132,6 +132,10 @@ class TestCase: filename="test_HRES-GFS_r.grib", should_error=False, ), + TestCase( + filename="test_HRES-GFS_aptmp.grib", + should_error=True, + ), TestCase( filename="test_UM-Global_t2m.grib", should_error=True,