question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: running pytest fails on master

See original GitHub issue

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the master branch of pandas.

Reproducible Example

pytest pandas

Issue Description

Running the pytest command fails with an import error

ImportError while loading conftest '/workspaces/pandas/pandas/conftest.py'.
pandas/conftest.py:537: in <module>
    "mi-with-dt64tz-level": _create_mi_with_dt64tz_level(),
pandas/conftest.py:505: in _create_mi_with_dt64tz_level
    return MultiIndex.from_product(
pandas/core/indexes/multi.py:619: in from_product
    codes, levels = factorize_from_iterables(iterables)
pandas/core/arrays/categorical.py:2862: in factorize_from_iterables
    codes, categories = zip(*(factorize_from_iterable(it) for it in iterables))
pandas/core/arrays/categorical.py:2862: in <genexpr>
    codes, categories = zip(*(factorize_from_iterable(it) for it in iterables))
pandas/core/arrays/categorical.py:2835: in factorize_from_iterable
    cat = Categorical(values, ordered=False)
pandas/core/arrays/categorical.py:440: in __init__
    codes, categories = factorize(values, sort=False)
pandas/core/algorithms.py:746: in factorize
    codes, uniques = values.factorize(sort=sort)
pandas/core/arrays/datetimelike.py:1830: in factorize
    uniques = self.copy()  # TODO: copy or view?
pandas/core/arrays/datetimelike.py:512: in copy
    new_obj = super().copy(order=order)  # type: ignore[call-arg]
E   TypeError: copy() takes no keyword arguments

I’m running on pandas’ VSCode dev container.

Expected Behavior

Should not fail, but run the tests instead.

Installed Versions

INSTALLED VERSIONS
------------------
commit           : c323494e7313b9ac105e59d0748cd3ac53adf89d
python           : 3.8.12.final.0
python-bits      : 64
OS               : Linux
OS-release       : 5.10.76-linuxkit
Version          : #1 SMP Mon Nov 8 10:21:19 UTC 2021
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : C.UTF-8
LANG             : C.UTF-8
LOCALE           : en_US.UTF-8

pandas : 1.4.0.dev0+1469.gc323494e73 numpy : 1.21.4 pytz : 2021.3 dateutil : 2.8.2 pip : 21.3.1 setuptools : 59.6.0 Cython : 0.29.26 pytest : 6.2.5 hypothesis : 6.31.6 sphinx : 4.3.2 blosc : None feather : None xlsxwriter : 3.0.2 lxml.etree : 4.7.1 html5lib : 1.1 pymysql : None psycopg2 : None jinja2 : 3.0.3 IPython : 7.30.1 pandas_datareader: None bs4 : 4.10.0 bottleneck : 1.3.2 fsspec : 2021.11.0 fastparquet : 0.7.2 gcsfs : 2021.11.0 matplotlib : 3.5.1 numexpr : 2.8.0 odfpy : None openpyxl : 3.0.9 pandas_gbq : None pyarrow : 6.0.1 pyxlsb : None s3fs : 2021.11.0 scipy : 1.7.3 sqlalchemy : 1.4.28 tables : 3.6.1 tabulate : 0.8.9 xarray : 0.18.2 xlrd : 2.0.1 xlwt : 1.3.0 numba : 0.53.1 zstandard : None

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jmg-duartecommented, Dec 24, 2021

Update: rebuilding the extensions seems to have worked.

Closing.

0reactions
MarcoGorellicommented, Dec 24, 2021

😄 no worries, glad it’s working now!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pytest is failing on GitHub Actions but succeeds locally
This is tested using Pytest. On my local environment, all tests are passing. However, they're failing on GitHub actions.
Read more >
Changelog — pytest-django documentation
Change the admin_user fixture to use get_by_natural_key() to get the user instead of directly using USERNAME_FIELD , in case it is overridden, and...
Read more >
Pytest best practices for libraries - Towards Data Science
The code has to pass all three levels of testing. Failing on a higher level restarts the code from the lowest level. 1.2...
Read more >
pytest-cov - Read the Docs
Consistent pytest behavior. If you run coverage run -m pytest you will have slightly different sys. path (CWD will be in it, unlike...
Read more >
pytest-rerunfailures - PyPI
pytest plugin to re-run tests to eliminate flaky failures. ... are generated for the case, one for the test case and the other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found