Skip to content

Commit

Permalink
Use result of pydantic_dataclass, will silence linters (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienPensart authored Jun 2, 2024
1 parent 0068b29 commit d88187a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion edgedb/codegen/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __get_pydantic_core_schema__(cls, _source_type, _handler):
def __get_validators__(cls):
# Pydantic 1.x
from pydantic.dataclasses import dataclass as pydantic_dataclass
pydantic_dataclass(cls)
_ = pydantic_dataclass(cls)
cls.__pydantic_model__.__get_validators__ = lambda: []
return []\
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NoPydanticValidation:
def __get_validators__(cls):
# Pydantic 1.x
from pydantic.dataclasses import dataclass as pydantic_dataclass
pydantic_dataclass(cls)
_ = pydantic_dataclass(cls)
cls.__pydantic_model__.__get_validators__ = lambda: []
return []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NoPydanticValidation:
def __get_validators__(cls):
# Pydantic 1.x
from pydantic.dataclasses import dataclass as pydantic_dataclass
pydantic_dataclass(cls)
_ = pydantic_dataclass(cls)
cls.__pydantic_model__.__get_validators__ = lambda: []
return []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NoPydanticValidation:
def __get_validators__(cls):
# Pydantic 1.x
from pydantic.dataclasses import dataclass as pydantic_dataclass
pydantic_dataclass(cls)
_ = pydantic_dataclass(cls)
cls.__pydantic_model__.__get_validators__ = lambda: []
return []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NoPydanticValidation:
def __get_validators__(cls):
# Pydantic 1.x
from pydantic.dataclasses import dataclass as pydantic_dataclass
pydantic_dataclass(cls)
_ = pydantic_dataclass(cls)
cls.__pydantic_model__.__get_validators__ = lambda: []
return []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NoPydanticValidation:
def __get_validators__(cls):
# Pydantic 1.x
from pydantic.dataclasses import dataclass as pydantic_dataclass
pydantic_dataclass(cls)
_ = pydantic_dataclass(cls)
cls.__pydantic_model__.__get_validators__ = lambda: []
return []

Expand Down

0 comments on commit d88187a

Please sign in to comment.