From ed6a6e3630461e288e63b830f04635bdcd1216ce Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Thu, 16 Jan 2025 12:25:58 -0700 Subject: [PATCH 1/3] Install s3fs as a test requirement This allows the requirements.txt to be solved in a self consistent manner. Otherwise installing s3fs later can lead to botcore and boto3 becoming incompatible with each other. --- .github/workflows/build.yaml | 1 - requirements/test.in | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1d1766c17e..bb7203e6ba 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -64,7 +64,6 @@ jobs: run: | pip install uv uv pip install -r requirements.txt - uv pip install fsspec s3fs # We have two cores so we can speed up the testing with xdist - name: Install pytest packages diff --git a/requirements/test.in b/requirements/test.in index 9634b269c5..fd0b11848a 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -3,3 +3,5 @@ moto >= 1.3 numpy >= 1.17, <2 pandas >= 1.0 testing.postgresql +s3fs +fsspec From 33203015fb795248167a12f2693436985778cbae Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Thu, 16 Jan 2025 14:42:45 -0700 Subject: [PATCH 2/3] Allow numpy 2 in requirements --- requirements/main.in | 4 +--- requirements/test.in | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/requirements/main.in b/requirements/main.in index 05bbd51395..df560d7734 100644 --- a/requirements/main.in +++ b/requirements/main.in @@ -6,9 +6,7 @@ pydantic >=2,<3.0 deprecated >=1.2 pyarrow >= 0.16 psycopg2 - -# Numpy 2 is not supported by the stack yet. -numpy < 2 +numpy # Butler CLI dependencies click >7.0 diff --git a/requirements/test.in b/requirements/test.in index fd0b11848a..7e23fd7e71 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -1,6 +1,6 @@ matplotlib >= 3.0.3 moto >= 1.3 -numpy >= 1.17, <2 +numpy >= 1.17 pandas >= 1.0 testing.postgresql s3fs From ac1af00c5d6ea8c6b86d1f8553b170490ab9fac3 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Thu, 16 Jan 2025 15:24:28 -0700 Subject: [PATCH 3/3] Cast astropy time MJD to float from np.float64 In numpy 2 sqlalchemy refuses to handle np.float64 and so the times must be converted to Python float. --- python/lsst/daf/butler/registry/obscore/_records.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lsst/daf/butler/registry/obscore/_records.py b/python/lsst/daf/butler/registry/obscore/_records.py index bbd29bfadf..0e9eb40ac3 100644 --- a/python/lsst/daf/butler/registry/obscore/_records.py +++ b/python/lsst/daf/butler/registry/obscore/_records.py @@ -181,10 +181,10 @@ def __call__(self, ref: DatasetRef) -> Record | None: if timespan is not None: if timespan.begin is not None: t_min = cast(astropy.time.Time, timespan.begin) - record["t_min"] = t_min.mjd + record["t_min"] = float(t_min.mjd) if timespan.end is not None: t_max = cast(astropy.time.Time, timespan.end) - record["t_max"] = t_max.mjd + record["t_max"] = float(t_max.mjd) region = dataId.region if self.exposure.name in dataId: