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

Pandas Deprecation Warning #614

Closed
patrickdemers6 opened this issue Jun 17, 2021 · 5 comments · Fixed by #617
Closed

Pandas Deprecation Warning #614

patrickdemers6 opened this issue Jun 17, 2021 · 5 comments · Fixed by #617

Comments

@patrickdemers6
Copy link

Describe the bug
Deprecation warnings are generated for Pandas current usage of the pandas API.

/home/patrick/Programming/github/PrISUm/Strategy/venv/lib/python3.6/site-packages/pyfakefs/fake_filesystem_unittest.py:575: FutureWarning: The pandas.np module is deprecated and will be removed from pandas in a future version. Import numpy directly instead
  if mod.__name__ in module_names and inspect.ismodule(mod):
/home/patrick/Programming/github/PrISUm/Strategy/venv/lib/python3.6/site-packages/pyfakefs/fake_filesystem_unittest.py:593: FutureWarning: The pandas.np module is deprecated and will be removed from pandas in a future version. Import numpy directly instead
  return (fct.__name__ in self._fake_module_functions and
/home/patrick/Programming/github/PrISUm/Strategy/venv/lib/python3.6/site-packages/pandas/util/__init__.py:23: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
  import pandas.util.testing

How To Reproduce
A sample unit test case to generate this error message:

import os
from pyfakefs.fake_filesystem_unittest import TestCase

class Test(TestCase):
    def setUp(self):
        self.setUpPyfakefs()

    def test_parse_race(self):
        print(os.getcwd())
        return True

Your environment

  • Linux-5.4.0-73-generic-x86_64-with-elementary-5.1.7-hera
  • Python 3.6.9 (default, Jan 26 2021, 15:33:00) GCC 8.4.0
  • pyfakefs 4.5.0
  • pandas 1.2.4
@mrbean-bremen
Copy link
Member

Sorry, missed this issue for some reason... thanks for the report!
We do not use the deprecated API, as far as I can see. This seems to be a side effect of inspecting the loaded module - we have to deprecate any warnings. I thought we already did this, but obviously we do this not everywhere where needed.

@mrbean-bremen
Copy link
Member

@patrickdemers6 - shall be fixed in master now, please check!

@patrickdemers6
Copy link
Author

I'm sure it's great! Is there an easy way to use the latest version in my project when a release hasn't been created?

@mrbean-bremen
Copy link
Member

Is there an easy way to use the latest version in my project when a release hasn't been created?

You can install it from source:

pip install git+https://github.com/jmcgeheeiv/pyfakefs

@patrickdemers6
Copy link
Author

I can confirm there aren't any warnings shown when running my test. Thanks for resolving this so quickly!

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 a pull request may close this issue.

2 participants