Skip to content

Commit 8c8b880

Browse files
authored
Merge pull request #106 from microsoft/Tarun/Pydantic
Migrate Pydantic V2
2 parents 3691eae + 3ff7639 commit 8c8b880

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

azureml_inference_server_http/server/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class AMLInferenceServerConfig(BaseSettings):
145145
debug_port: Optional[int] = pydantic.Field(default=None, alias="AZUREML_DEBUG_PORT")
146146

147147
# Check if extra keys are there in the config file
148-
@pydantic.root_validator(pre=True)
148+
@pydantic.model_validator(mode="before")
149149
def check_extra_keys(cls, values: Dict[str, Any]):
150150
supported_keys = alias_mapping.values()
151151
extra_keys = []

tests/server/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ def app_appinsights(config):
6464

6565
@pytest.fixture()
6666
def config():
67-
backup_config = server_config.copy()
67+
backup_config = server_config.model_copy()
6868
try:
6969
yield server_config
7070
finally:
71-
for field in server_config.__fields__:
71+
for field in server_config.model_fields:
7272
setattr(server_config, field, getattr(backup_config, field))
7373

7474

0 commit comments

Comments
 (0)