-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor logging, misc refactors (#271)
- Loading branch information
1 parent
40a142e
commit f945d5e
Showing
6 changed files
with
83 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
import logging | ||
from enum import Enum | ||
|
||
from pydantic import BaseModel, ConfigDict, model_validator | ||
|
||
|
||
class OnOffEnum(str, Enum): | ||
ON = "ON" | ||
OFF = "OFF" | ||
|
||
|
||
class TDMBaseModel(BaseModel): | ||
model_config = ConfigDict(extra="allow") | ||
|
||
@model_validator(mode="after") | ||
def log_extra_fields(cls, values): | ||
if cls.__name__ != "StatusSNSSchema" and values.model_extra: | ||
logging.warning("%s has extra fields: %s", cls.__name__, values.model_extra) | ||
return values |
Oops, something went wrong.