From b7bf915c526b7b2015b2cc4145ade1f14e482c46 Mon Sep 17 00:00:00 2001 From: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com> Date: Sat, 25 Nov 2023 13:36:54 +1300 Subject: [PATCH] Update to Pydantic 2.x Pydantic uses `.model_dump()` no longer simply `.dict()`. Signed-off-by: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com> --- src/ITR/data/vault_providers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ITR/data/vault_providers.py b/src/ITR/data/vault_providers.py index 781178f1..376d21c0 100644 --- a/src/ITR/data/vault_providers.py +++ b/src/ITR/data/vault_providers.py @@ -464,9 +464,9 @@ def __init__( ) df = pd.DataFrame() for scope in ["AnyScope"]: - if production_benchmarks.dict()[scope] is None: + if production_benchmarks.model_dump()[scope] is None: continue - for benchmark in production_benchmarks.dict()[scope]["benchmarks"]: + for benchmark in production_benchmarks.model_dump()[scope]["benchmarks"]: bdf = pd.DataFrame.from_dict( { r["year"]: [ @@ -519,9 +519,9 @@ def __init__( self.projection_controls = projection_controls df = pd.DataFrame() for scope in EScope.get_scopes(): - if EI_benchmarks.dict()[scope] is None: + if EI_benchmarks.model_dump()[scope] is None: continue - for benchmark in EI_benchmarks.dict()[scope]["benchmarks"]: + for benchmark in EI_benchmarks.model_dump()[scope]["benchmarks"]: benchmark_df = pd.DataFrame.from_dict( { r["year"]: [