From 9e0ccebd4b9b11b35d02bf06e3a0a0a9692d742c Mon Sep 17 00:00:00 2001 From: Roel Arents Date: Mon, 18 Nov 2024 10:47:31 +0100 Subject: [PATCH] fix deprecated pydantic model Config PDOK-16629 --- geopackage_validator/models.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/geopackage_validator/models.py b/geopackage_validator/models.py index 7d6058f..07d6edd 100644 --- a/geopackage_validator/models.py +++ b/geopackage_validator/models.py @@ -1,7 +1,7 @@ import copy from typing import Optional, Tuple -from pydantic import BaseModel, Field, field_validator +from pydantic import BaseModel, Field, field_validator, ConfigDict from semver import Version @@ -10,31 +10,27 @@ class Named(BaseModel): class ColumnDefinition(Named): - class Config: - frozen = True + model_config = ConfigDict(frozen=True) type: str class IndexDefinition(BaseModel): - class Config: - frozen = True + model_config = ConfigDict(frozen=True) columns: Tuple[str, ...] = Field(min_length=1) unique: bool = False class ColumnMapping(BaseModel): - class Config: - frozen = True + model_config = ConfigDict(frozen=True) src: str dst: str class ForeignKeyDefinition(BaseModel): - class Config: - frozen = True + model_config = ConfigDict(frozen=True) @field_validator("columns") @classmethod @@ -53,8 +49,7 @@ def unique_src_columns( class TableDefinition(Named): - class Config: - frozen = True + model_config = ConfigDict(frozen=True) geometry_column: str = "geom" columns: Tuple[ColumnDefinition, ...] = tuple() @@ -67,8 +62,7 @@ class Config: class TablesDefinition(BaseModel): - class Config: - frozen = True + model_config = ConfigDict(frozen=True) geopackage_validator_version: str = "0" projection: Optional[int]