From b9dacf16f9251bea7f9ccc0e084b70f13aee9f96 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 11 Nov 2021 13:32:26 -0800 Subject: [PATCH] Avoid string types when using ClassVar As of Python 3.9.8, this does not work with Pydantic BaseModel, and does not work in a way that causes the whole module to fail to import. See https://github.com/samuelcolvin/pydantic/issues/3401. In general, Pydantic does not work well with string types as enabled by from __future__ import annotations. --- python/lsst/daf/butler/core/logging.py | 2 -- python/lsst/daf/butler/core/serverModels.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/python/lsst/daf/butler/core/logging.py b/python/lsst/daf/butler/core/logging.py index d102a0d09d..995372ddc4 100644 --- a/python/lsst/daf/butler/core/logging.py +++ b/python/lsst/daf/butler/core/logging.py @@ -19,8 +19,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from __future__ import annotations - __all__ = ("ButlerMDC", "ButlerLogRecords", "ButlerLogRecordHandler", "ButlerLogRecord", "JsonLogFormatter") diff --git a/python/lsst/daf/butler/core/serverModels.py b/python/lsst/daf/butler/core/serverModels.py index da887265ee..f657de8a63 100644 --- a/python/lsst/daf/butler/core/serverModels.py +++ b/python/lsst/daf/butler/core/serverModels.py @@ -19,8 +19,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from __future__ import annotations - __all__ = ( "QueryDatasetsModel", "QueryDataIdsModel",