diff --git a/requirements.txt b/requirements.txt index dd9f1a869..f609cdbca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ scipy>=1.4.1, <1.12 pandas>1.1, <2.1, !=1.4.0 matplotlib>=3.2, <=3.7.3 -pydantic>=1.8.1, <2 +pydantic>=2 +pydantic-settings>=2 PyYAML>=5.0.0, <6.1 jinja2>=2.11.1, <3.2 visions[type_image_path]==0.7.5 diff --git a/src/ydata_profiling/config.py b/src/ydata_profiling/config.py index f4b8caedb..e7e561e96 100644 --- a/src/ydata_profiling/config.py +++ b/src/ydata_profiling/config.py @@ -4,7 +4,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union import yaml -from pydantic import BaseModel, BaseSettings, Field, PrivateAttr +from pydantic.v1 import BaseModel, BaseSettings, Field, PrivateAttr def _merge_dictionaries(dict1: dict, dict2: dict) -> dict: @@ -348,7 +348,7 @@ class Config: # Report rendering report: Report = Report() html: Html = Html() - notebook = Notebook() + notebook: Notebook = Notebook() def update(self, updates: dict) -> "Settings": update = _merge_dictionaries(self.dict(), updates) @@ -366,7 +366,7 @@ def from_file(config_file: Union[Path, str]) -> "Settings": with open(config_file) as f: data = yaml.safe_load(f) - return Settings().parse_obj(data) + return Settings.parse_obj(data) class SparkSettings(Settings): @@ -379,7 +379,7 @@ class SparkSettings(Settings): vars.num.low_categorical_threshold = 0 - infer_dtypes = False + infer_dtypes: bool = False correlations: Dict[str, Correlation] = { "spearman": Correlation(key="spearman", calculate=True), diff --git a/src/ydata_profiling/model/sample.py b/src/ydata_profiling/model/sample.py index 0f3ba141a..c440bb26e 100644 --- a/src/ydata_profiling/model/sample.py +++ b/src/ydata_profiling/model/sample.py @@ -1,7 +1,7 @@ from typing import List, Optional, TypeVar from multimethod import multimethod -from pydantic.main import BaseModel +from pydantic.v1 import BaseModel from ydata_profiling.config import Settings