Skip to content

Commit

Permalink
Significantly speed up timezone validator
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvdende committed May 19, 2019
1 parent f90a08f commit 599f8f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opulent_pandas/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class TimezoneValidator(BaseValidator):
"""

def validate(self, df_column: pd.Series):
if not (df_column.apply(lambda x: x.tz is not None)).all():
if not df_column.dt.tz:
raise MissingTimezoneError(
f"Non-timezone-aware dates found for column: {df_column.name}."
)

0 comments on commit 599f8f7

Please sign in to comment.