Skip to content

Commit

Permalink
Update to Pydantic 2.x
Browse files Browse the repository at this point in the history
Pydantic uses `.model_dump()` no longer simply `.dict()`.

Signed-off-by: Michael Tiemann <[email protected]>
  • Loading branch information
MichaelTiemannOSC committed Nov 25, 2023
1 parent af7b6c7 commit b7bf915
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ITR/data/vault_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]: [
Expand Down Expand Up @@ -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"]: [
Expand Down

0 comments on commit b7bf915

Please sign in to comment.