From 58cf6d10b2b9e42dedcea55682f5000918149327 Mon Sep 17 00:00:00 2001 From: Anders Nord Date: Sat, 27 Apr 2024 00:55:35 +0200 Subject: [PATCH] fix typing again --- src/smhi/metobs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/smhi/metobs.py b/src/smhi/metobs.py index d87599c..53f9379 100644 --- a/src/smhi/metobs.py +++ b/src/smhi/metobs.py @@ -324,7 +324,8 @@ def __init__( super().__init__() if period == "not-set": - period = sorted(periods_in_station, key=lambda x: x.key).data[0] + available_periods = sorted(periods_in_station.data) + period = available_periods[0] if data_type != "json": raise TypeError("Only json supported.")