Giter Site home page Giter Site logo

Comments (5)

ritchie46 avatar ritchie46 commented on September 21, 2024

Is main broken now? I am surprised the parameteric tests don't run. Though for CI, I must defer to @stinodego.

from polars.

itamarst avatar itamarst commented on September 21, 2024

I edited the text, it may be the issue is that my computer is faster so it runs more examples through Hypothesis. But there are failing tests on main for me. E.g.:

$ pytest tests/unit/interchange/test_roundtrip.py -m hypothesis 
==================================================================================== test session starts =====================================================================================platform linux -- Python 3.10.12, pytest-7.4.4, pluggy-1.3.0
rootdir: /home/itamarst/devel/polars/py-polars
configfile: pyproject.toml
plugins: cov-4.1.0, anyio-4.2.0, hypothesis-6.88.1, xdist-3.3.1
collected 14 items / 4 deselected / 10 selected                                                                                                                                              

tests/unit/interchange/test_roundtrip.py ......FF..                                                                                                                                    [100%]

========================================================================================== FAILURES ==========================================================================================___________________________________________________________________________ test_from_dataframe_pandas_parametric ____________________________________________________________________________tests/unit/interchange/test_roundtrip.py:135: in test_from_dataframe_pandas_parametric
    dataframes(
tests/unit/interchange/test_roundtrip.py:150: in test_from_dataframe_pandas_parametric
    result = pl.from_dataframe(df_pd)
polars/convert.py:771: in from_dataframe
    return from_dataframe(df, allow_copy=allow_copy)
polars/interchange/from_dataframe.py:46: in from_dataframe
    return _from_dataframe(
polars/interchange/from_dataframe.py:55: in _from_dataframe
    polars_chunk = _protocol_df_chunk_to_polars(chunk, allow_copy=allow_copy)
polars/interchange/from_dataframe.py:71: in _protocol_df_chunk_to_polars
    dtype = dtype_to_polars_dtype(column.dtype)
properties.pyx:36: in pandas._libs.properties.CachedProperty.__get__
    ???
../.venv/lib/python3.10/site-packages/pandas/core/interchange/column.py:128: in dtype
    return self._dtype_from_pandasdtype(dtype)
../.venv/lib/python3.10/site-packages/pandas/core/interchange/column.py:141: in _dtype_from_pandasdtype
    raise ValueError(f"Data type {dtype} not supported by interchange protocol")
E   ValueError: Data type large_string[pyarrow] not supported by interchange protocol
E   Falsifying example: test_from_dataframe_pandas_parametric(
E       df=shape: (0, 1)
E       ┌──────┐
E       │ col0 │
E       │ ---  │
E       │ str  │
E       ╞══════╡
E       └──────┘,
E   )
E   Explanation:
E       These lines were always and only run by failing examples:
E           /home/itamarst/devel/polars/.venv/lib/python3.10/site-packages/pandas/core/dtypes/dtypes.py:2152
E           /home/itamarst/devel/polars/.venv/lib/python3.10/site-packages/pandas/core/interchange/column.py:141
______________________________________________________________________ test_from_dataframe_pandas_zero_copy_parametric _______________________________________________________________________polars/testing/asserts/frame.py:114: in assert_frame_equal
    _assert_series_values_equal(
polars/testing/asserts/series.py:180: in _assert_series_values_equal
    raise_assertion_error(
E   AssertionError: Series are different (exact value mismatch)
E   [left]:  [datetime.datetime(1974, 2, 4, 21, 23, 8, 840384)]
E   [right]: [datetime.datetime(2000, 1, 1, 0, 0)]

The above exception was the direct cause of the following exception:
tests/unit/interchange/test_roundtrip.py:155: in test_from_dataframe_pandas_zero_copy_parametric
    dataframes(
tests/unit/interchange/test_roundtrip.py:177: in test_from_dataframe_pandas_zero_copy_parametric
    assert_frame_equal(result, df)
polars/testing/asserts/frame.py:123: in assert_frame_equal
    raise_assertion_error(
E   AssertionError: DataFrames are different (value mismatch for column 'col0')
E   [left]:  [datetime.datetime(1974, 2, 4, 21, 23, 8, 840384)]
E   [right]: [datetime.datetime(2000, 1, 1, 0, 0)]
E   Falsifying example: test_from_dataframe_pandas_zero_copy_parametric(
E       df=shape: (1, 1)
E       ┌─────────────────────┐
E       │ col0                │
E       │ ---                 │
E       │ datetime[μs]        │
E       ╞═════════════════════╡
E       │ 2000-01-01 00:00:00 │
E       └─────────────────────┘,
E   )
E   Explanation:
E       These lines were always and only run by failing examples:
E           /home/itamarst/devel/polars/.venv/lib/python3.10/site-packages/pandas/core/arrays/arrow/array.py:1224
E           /home/itamarst/devel/polars/.venv/lib/python3.10/site-packages/pandas/core/arrays/arrow/array.py:1238
E           /home/itamarst/devel/polars/.venv/lib/python3.10/site-packages/pandas/core/arrays/arrow/array.py:1272
E           /home/itamarst/devel/polars/.venv/lib/python3.10/site-packages/pandas/core/arrays/datetimelike.py:354
E           /home/itamarst/devel/polars/.venv/lib/python3.10/site-packages/pandas/core/construction.py:616
E           (and 54 more with settings.verbosity >= verbose)
================================================================================== short test summary info ===================================================================================FAILED tests/unit/interchange/test_roundtrip.py::test_from_dataframe_pandas_parametric - ValueError: Data type large_string[pyarrow] not supported by interchange protocol
FAILED tests/unit/interchange/test_roundtrip.py::test_from_dataframe_pandas_zero_copy_parametric - AssertionError: DataFrames are different (value mismatch for column 'col0')
========================================================================= 2 failed, 8 passed, 4 deselected in 21.59s =========================================================================

from polars.

MarcoGorelli avatar MarcoGorelli commented on September 21, 2024

I think you just need to update your pandas version

from polars.

itamarst avatar itamarst commented on September 21, 2024

Earlier today I was on 2.1.4. I just upgraded to 2.2.0, and now I'm getting just failing tests to DeprecationWarning on test_roundtrip.py, rather than what I was getting before. So, maybe. Any sense why DeprecationWarnings would be errors locally but not in CI?

from polars.

itamarst avatar itamarst commented on September 21, 2024

Anyway can't reproduce with Pandas 2.2.0 so closing, sorry for the noise.

from polars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.