Skip to content

Commit

Permalink
chore(deps): bump to pydantic v2 (#1483)
Browse files Browse the repository at this point in the history
  • Loading branch information
portellaa authored Oct 23, 2023
1 parent 8f4f622 commit b5228d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/ydata_profiling/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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):
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/ydata_profiling/model/sample.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit b5228d4

Please sign in to comment.