From 6201d579639a11674d0540be4b2cc83e78631da0 Mon Sep 17 00:00:00 2001 From: Xarray-Beam authors Date: Wed, 2 Dec 2026 18:02:56 -0800 Subject: [PATCH] Use lowercase hourly pandas frequency aliases in tests Replace deprecated uppercase `H` frequency strings (`1H`, `6H`, `24H`) with lowercase `h` (`1h`, `6h`, `24h`) for pandas 3.0 compatibility. PiperOrigin-RevId: 1034953209 --- examples/era5_climatology_test.py | 2 +- xarray_beam/_src/dataset_test.py | 10 +++++----- xarray_beam/_src/test_util.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/era5_climatology_test.py b/examples/era5_climatology_test.py index 64d48be..503b40f 100644 --- a/examples/era5_climatology_test.py +++ b/examples/era5_climatology_test.py @@ -27,7 +27,7 @@ def test(self): input_path = self.create_tempdir('source').full_path output_path = self.create_tempdir('destination').full_path - input_ds = test_util.dummy_era5_surface_dataset(times=90 * 24, freq='1H') + input_ds = test_util.dummy_era5_surface_dataset(times=90 * 24, freq='1h') input_ds.chunk({'time': 31}).to_zarr(input_path) expected = input_ds.groupby('time.month').apply( diff --git a/xarray_beam/_src/dataset_test.py b/xarray_beam/_src/dataset_test.py index 22aecae..21bcb77 100644 --- a/xarray_beam/_src/dataset_test.py +++ b/xarray_beam/_src/dataset_test.py @@ -1262,7 +1262,7 @@ class EndToEndTest(test_util.TestCase): def test_bytes_per_chunk_and_chunk_count(self): source_ds = test_util.dummy_era5_surface_dataset( - variables=2, latitudes=73, longitudes=144, times=365, freq='24H' + variables=2, latitudes=73, longitudes=144, times=365, freq='24h' ) xbeam_ds = xbeam.Dataset.from_xarray( @@ -1288,7 +1288,7 @@ def test_docstring_example(self): output_path = self.create_tempdir('output').full_path source_ds = test_util.dummy_era5_surface_dataset( - variables=2, latitudes=73, longitudes=144, times=365, freq='24H' + variables=2, latitudes=73, longitudes=144, times=365, freq='24h' ) source_ds.chunk({'time': 90}).to_zarr(input_path) @@ -1309,7 +1309,7 @@ def test_climatology(self): input_path = self.create_tempdir('source').full_path output_path = self.create_tempdir('output').full_path - source_ds = test_util.dummy_era5_surface_dataset(times=365, freq='24H') + source_ds = test_util.dummy_era5_surface_dataset(times=365, freq='24h') source_ds.chunk({'time': 90}).to_zarr(input_path) transform = ( @@ -1330,7 +1330,7 @@ def test_resample(self): output_path = self.create_tempdir('output').full_path source_ds = test_util.dummy_era5_surface_dataset( - latitudes=73, longitudes=144, times=365, freq='24H' + latitudes=73, longitudes=144, times=365, freq='24h' ) source_ds.chunk({'time': 90}).to_zarr(input_path) @@ -1359,7 +1359,7 @@ def test_multiple_analysis_ready_outputs(self): climatology_path = self.create_tempdir('climatology').full_path source_ds = test_util.dummy_era5_surface_dataset( - latitudes=73, longitudes=144, times=365, freq='24H' + latitudes=73, longitudes=144, times=365, freq='24h' ) source_ds.chunk({'time': 30}).to_zarr(input_path) diff --git a/xarray_beam/_src/test_util.py b/xarray_beam/_src/test_util.py index fcba90b..614d399 100644 --- a/xarray_beam/_src/test_util.py +++ b/xarray_beam/_src/test_util.py @@ -78,7 +78,7 @@ def dummy_era5_surface_dataset( latitudes=73, longitudes=144, times=365 * 4, - freq='6H', + freq='6h', ): """A mock version of the Pangeo ERA5 surface reanalysis dataset.""" # based on: gs://pangeo-era5/reanalysis/spatial-analysis