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

TST: add test for df comparing strings to numbers raises ValueError #29535

Merged

Conversation

ganevgv
Copy link
Contributor

@ganevgv ganevgv commented Nov 10, 2019

{x: {"x": "foo", "y": "bar", "z": "baz"} for x in ["a", "b", "c"]}
)
with pytest.raises(TypeError):
df > 0
Copy link
Member

Choose a reason for hiding this comment

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

Can you pytest.mark.parameterize over all the operators? I think we have a fixture.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @mroeschke - now using parameterize to go over ["lt", "le", "gt", "ge", "eq", "ne"].

@mroeschke mroeschke added Numeric Operations Arithmetic, Comparison, and Logical operations Testing pandas testing functions or related to the test suite labels Nov 11, 2019
@@ -530,6 +530,34 @@ def test_comp(func):
test_comp(operator.ge)
test_comp(operator.le)

@pytest.mark.parametrize("op", ["lt", "le", "gt", "ge", "eq", "ne"])
Copy link
Member

Choose a reason for hiding this comment

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

Can you use the compare_operators_no_eq_ne pytest fixture instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @mroeschke - that was neat! Now using compare_operators_no_eq_ne.

@jreback jreback added this to the 1.0 milestone Nov 12, 2019
@jreback jreback merged commit beb23bd into pandas-dev:master Nov 12, 2019
@jreback
Copy link
Contributor

jreback commented Nov 12, 2019

thanks @ganevgv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Numeric Operations Arithmetic, Comparison, and Logical operations Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comparing Strings to Numbers: No ValueError
3 participants