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

Fix deprecation and test #2021

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Fix deprecation and test #2021

merged 2 commits into from
Jul 26, 2024

Conversation

kounelisagis
Copy link
Member

@kounelisagis kounelisagis requested a review from ihnorton July 26, 2024 17:22
@kounelisagis kounelisagis merged commit e29bf73 into dev Jul 26, 2024
33 checks passed
@kounelisagis kounelisagis deleted the agis/fix-deprecation-and-test branch July 26, 2024 17:46
@@ -28,6 +28,9 @@

if not has_pandas():
pytest.skip("pandas>=1.0,<3.0 not installed", allow_module_level=True)
else:
pd = pytest.importorskip("pandas")
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't make sense to me - what are we trying to do here? The original line worked correctly.

Copy link
Member Author

@kounelisagis kounelisagis Jul 26, 2024

Choose a reason for hiding this comment

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

original code is not checking for the pandas version. New code wasn't importing pandas, even if it exists.

Copy link
Contributor

@jdblischak jdblischak Jul 26, 2024

Choose a reason for hiding this comment

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

Suggested change
pd = pytest.importorskip("pandas")
import pandas as pd

The above call to has_pandas()+pytest.skip() already skips the test file if pandas isn't installed (or if it's the wrong version). Thus if has_pandas() evaluates to True, you can simply import pandas directly

Copy link
Contributor

@jdblischak jdblischak left a comment

Choose a reason for hiding this comment

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

Since it wasn't explicitly stated, the reason that the CI for #2016 passed is because pandas is not in pyproject.toml. Thus it is not installed and all the tests in test_pandas_dataframe.py are skipped

@@ -28,6 +28,9 @@

if not has_pandas():
pytest.skip("pandas>=1.0,<3.0 not installed", allow_module_level=True)
else:
pd = pytest.importorskip("pandas")
Copy link
Contributor

@jdblischak jdblischak Jul 26, 2024

Choose a reason for hiding this comment

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

Suggested change
pd = pytest.importorskip("pandas")
import pandas as pd

The above call to has_pandas()+pytest.skip() already skips the test file if pandas isn't installed (or if it's the wrong version). Thus if has_pandas() evaluates to True, you can simply import pandas directly

@jdblischak
Copy link
Contributor

@kounelisagis thanks for the quick fixes! In the future, could you please @ mention me in any PRs that address Issue(s) I am troubleshooting?

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.

4 participants