Skip to content

TST: Remove broken test for deprecated functionality #38707

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

Merged

Conversation

theOehrly
Copy link
Contributor

Registering converters by default on import is deprecated since #28722.

The test did not fail as the subprocess call contains errors in the python code. Specifically, the code is in double and single quotes. This means that the python code passed to the subprocess call is never actually excecuted. Python in the subprocess is called to "excecute" a string. This is will simply finish with exit code 0 as there is nothing to do basically.
Additonally, the test code contains a stray closing bracket at the end which would make the code fail if it was excecuted.

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Registering converters by default is deprecated since GH28722.
The test did not fail as the subprocess call contains errors in the python code.
@jreback
Copy link
Contributor

jreback commented Dec 26, 2020

can u fix the test instead

@theOehrly
Copy link
Contributor Author

How would you want this test fixed? There is a test for registering the converters explicitly. I don't know what case still needs to be tested with this after converters are no longer automatically registered.

@jreback
Copy link
Contributor

jreback commented Dec 26, 2020

this is a test that is using a sub process so it's different - it makes sure that we are not corrupting things in import

@theOehrly
Copy link
Contributor Author

As far as my understanding went, there is nothing converter related done on import anymore. That's why I thought the test is no longer needed. But you are suggesting that something about the imports still needs to have a test.
I probably don't have a deep enough understanding of what is done there then. So somebody who knows this better should probably look at this to fix it properly.

def test_register_by_default(self):
# Run in subprocess to ensure a clean state
code = (
"'import matplotlib.units; "
Copy link
Contributor

Choose a reason for hiding this comment

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

if you fix the quoting here, does this test pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the assertion will fail then. Converters for pd.Timestamp and others are not added to units anymore on import

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh ok, then this is a truly test in need of removal (that was what i am confirming. thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

though i think having this test that the converters are NOT registered would actually be fine here, e.g. reverse the test as this functionaility is removed. The reason we are doing this in a subprocess as its very easy to have the ordering of imports change whether the converters is registered or not.

so we can remove the test, or better yet, to fix it and assert that pd.Timestamp is NOT added would be great.

@jreback jreback added Deprecate Functionality to remove in pandas Visualization plotting labels Dec 27, 2020
@jreback jreback added this to the 1.3 milestone Dec 27, 2020
@jreback jreback merged commit 279d55d into pandas-dev:master Dec 28, 2020
@jreback
Copy link
Contributor

jreback commented Dec 28, 2020

thanks @theOehrly

luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Visualization plotting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants