Skip to content
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

Merged
merged 4 commits into from
Sep 23, 2024
Merged

Feature/basedate tests #305

merged 4 commits into from
Sep 23, 2024

Conversation

limlam96
Copy link
Contributor

@limlam96 limlam96 commented Sep 16, 2024

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

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}
Copy link
Contributor

@davidhopkinson26 davidhopkinson26 Sep 23, 2024

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)?

Copy link
Contributor Author

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

Copy link
Contributor

@davidhopkinson26 davidhopkinson26 left a 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

@davidhopkinson26 davidhopkinson26 merged commit a166593 into main Sep 23, 2024
12 checks passed
@davidhopkinson26 davidhopkinson26 deleted the feature/basedate_tests branch September 23, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants