-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/basedate tests #305
Conversation
tubular/dates.py
Outdated
msg = f"{self.classname()}: {col} type should be in {allowed_types} but got {X[col].dtype}" | ||
col_dtype = date_type if is_date else X[col].dtype | ||
|
||
msg = f"{self.classname()}: {col} type should be in {allowed_types} but got {col_dtype}" | ||
raise TypeError(msg) | ||
|
||
present_types = set(type_dict.values()) | ||
|
||
only_datetime_present = present_types == {datetime_type} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: I think this bit of logic might be cleaned up a bit by comparing present_types to set(allowed_types)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good shout, updated here ae94c55
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with these changes
Hit some issues testing the datetime only transformers, so did a slight rework of the base class/base test setup to make generic date vs just datetime transformers less coupled