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

input checks and unit tests for TwoColumnOperatorTransformer #183

Merged
merged 5 commits into from
Apr 8, 2024

Conversation

ChaitanMohr
Copy link
Contributor

@ChaitanMohr ChaitanMohr commented Feb 23, 2024

This PR aims to edit the existing TwoColumnOperatorTransformer to ensure that:

  • a value error is raised when instantiated with empty columns list
  • a type error is raised when columns instantiated with a string

@ChaitanMohr ChaitanMohr linked an issue Feb 23, 2024 that may be closed by this pull request
ValueError,
match="columns must be a list containing two column names",
):
TwoColumnOperatorTransformer("mul", [], "c", pd_method_kwargs={"axis": 1})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you check this with a list of length one?

An empty list will evaluate to none and so could accidentally be picking up some other behaviour (I'm maybe being over cautious here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good with both empty and length one it seems

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we parameterise this test with both empty list and ['a']? https://docs.pytest.org/en/7.1.x/how-to/parametrize.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

included both tests for empty and length 1 a25f439

CHANGELOG.rst Outdated
@@ -34,6 +34,12 @@ Removed
this functionality. This required updating a lot of test files.
- The `columns_set_or_check()` method from BaseTransformer. With the above change it was no longer necessary. Subsequent updates to nominal transformers and their tests were required.

1.2.3 (2024-02-23)
Copy link
Contributor

@TommyMatthews TommyMatthews Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog is out of date, please can you pull the latest changes from main to your branch :)

Copy link
Contributor

@davidhopkinson26 davidhopkinson26 Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main is on 1.3.0 now:
https://github.com/lvgig/tubular/blob/main/CHANGELOG.rst

Need to pull changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this entry to under 1.3.0 please @ChaitanMohr ?

Copy link
Contributor Author

@ChaitanMohr ChaitanMohr Apr 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d1d8044 changed version here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm looks like the changelog is unchanged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated changelog 2544a1f

tubular/_version.py Outdated Show resolved Hide resolved
@davidhopkinson26
Copy link
Contributor

Hi @ChaitanMohr, please add a PR description. I know we have the linked issue but a descriptive PR description makes it clear what occured in this PR for future contributors.

@limlam96 limlam96 merged commit 5a7968b into main Apr 8, 2024
6 checks passed
@limlam96 limlam96 deleted the transformer_bugs branch April 8, 2024 13:05
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.

TwoColumnOperatorTransformer bugs
4 participants