Skip to content

Commit

Permalink
fix: missing migrations for pydantic v2 (#155)
Browse files Browse the repository at this point in the history
* fix: missing migrations for pydantic v2

* fix(linting): code formatting

---------

Co-authored-by: Azory YData Bot <[email protected]>
  • Loading branch information
portellaa and azory-ydata authored Feb 4, 2025
1 parent c6c7277 commit 91616da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ dependencies = [
"prettytable==3.13.*",
"pydantic>=2.0.0",
"typeguard==2.13.3",
"ydata-datascience"
"ydata-datascience",
"requests==2.*",
]

[project.license]
Expand Down
8 changes: 4 additions & 4 deletions src/ydata/sdk/common/status.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import Generic, Optional, TypeVar

from pydantic import Field
from pydantic import ConfigDict, Field

from .model import BaseModel

T = TypeVar("T")


class GenericStateErrorStatus(BaseModel, Generic[T]):
model_config = ConfigDict(
use_enum_values=True
)
state: Optional[T] = Field(None)

class Config:
use_enum_values = True
8 changes: 4 additions & 4 deletions src/ydata/sdk/datasources/_models/metadata/column.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from pydantic import Field
from pydantic import ConfigDict, Field

from ydata.sdk.common.model import BaseModel
from ydata.sdk.datasources._models.metadata.data_types import DataType, VariableType


class Column(BaseModel):
model_config = ConfigDict(
use_enum_values=True
)

name: str
datatype: DataType = Field(alias='dataType')
vartype: VariableType = Field(alias='varType')

class Config:
use_enum_values = True

def __repr__(self) -> str:
return f"Column(name={self.name}, datatype={self.datatype}, vartype={self.vartype})"

Expand Down

0 comments on commit 91616da

Please sign in to comment.