Skip to content

Commit

Permalink
refactor: validation at the DAOs level
Browse files Browse the repository at this point in the history
  • Loading branch information
mapledan committed Jan 23, 2024
1 parent 20e484e commit 6aee27c
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
relationship,
RelationshipProperty,
Session,
validates,
)
from sqlalchemy.orm.mapper import Mapper
from sqlalchemy.schema import UniqueConstraint
Expand Down Expand Up @@ -831,17 +830,6 @@ def init_on_load(self) -> None:
def __repr__(self) -> str:
return str(self.column_name)

@validates("python_date_format")
def validate_pdf_is_iso8601(self, _: str, dt_format: str) -> str:
if dt_format in ("epoch_s", "epoch_ms", None):
return dt_format
try:
dt_str = datetime.now().strftime(dt_format)
dateutil.parser.isoparse(dt_str)
except ValueError as ex:
raise ValueError("python_date_format is invalid ISO 8601 format") from ex
return dt_format

@property
def is_boolean(self) -> bool:
"""
Expand Down

0 comments on commit 6aee27c

Please sign in to comment.