Skip to content

CI: test_constructor_list_frames failures on MacPython #34972

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

Closed
TomAugspurger opened this issue Jun 24, 2020 · 1 comment
Closed

CI: test_constructor_list_frames failures on MacPython #34972

TomAugspurger opened this issue Jun 24, 2020 · 1 comment
Labels
CI Continuous Integration

Comments

@TomAugspurger
Copy link
Contributor

https://dev.azure.com/pandas-dev/pandas-wheels/_build/results?buildId=38048&view=logs&j=79f3a53a-4a6d-509c-98b5-ff6e9111f67c&t=25a63239-9c30-5cf0-cb4c-3d01da7b47c5&l=1049

___________ TestDataFrameConstructors.test_constructor_list_frames ____________
[gw0] win32 -- Python 3.6.8 D:\a\1\s\test_venv\Scripts\python.exe

self = <pandas.tests.frame.test_constructors.TestDataFrameConstructors object at 0x2882F090>

    @pytest.mark.xfail(_is_numpy_dev, reason="Interprets list of frame as 3D")
    def test_constructor_list_frames(self):
        # see gh-3243
>       result = DataFrame([DataFrame()])

test_venv\lib\site-packages\pandas\tests\frame\test_constructors.py:151: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_venv\lib\site-packages\pandas\core\frame.py:488: in __init__
    mgr = init_ndarray(data, index, columns, dtype=dtype, copy=copy)
test_venv\lib\site-packages\pandas\core\internals\construction.py:169: in init_ndarray
    values = prep_ndarray(values, copy=copy)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

values = array([], shape=(1, 0, 0), dtype=float64), copy = False

    def prep_ndarray(values, copy=True) -> np.ndarray:
        if not isinstance(values, (np.ndarray, ABCSeries, Index)):
            if len(values) == 0:
                return np.empty((0, 0), dtype=object)
            elif isinstance(values, range):
                arr = np.arange(values.start, values.stop, values.step, dtype="int64")
                return arr[..., np.newaxis]
    
            def convert(v):
                return maybe_convert_platform(v)
    
            # we could have a 1-dim or 2-dim list here
            # this is equiv of np.asarray, but does object conversion
            # and platform dtype preservation
            try:
                if is_list_like(values[0]) or hasattr(values[0], "len"):
                    values = np.array([convert(v) for v in values])
                elif isinstance(values[0], np.ndarray) and values[0].ndim == 0:
                    # GH#21861
                    values = np.array([convert(v) for v in values])
                else:
                    values = convert(values)
            except (ValueError, TypeError):
                values = convert(values)
    
        else:
    
            # drop subclass info, do not copy data
            values = np.asarray(values)
            if copy:
                values = values.copy()
    
>           raise ValueError("Must pass 2-d input")
E           ValueError: Must pass 2-d input

test_venv\lib\site-packages\pandas\core\internals\construction.py:295: ValueError
@TomAugspurger TomAugspurger added Bug Needs Triage Issue that has not been reviewed by a pandas team member CI Continuous Integration and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 24, 2020
@TomAugspurger
Copy link
Contributor Author

Duplicate of #32289.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration
Projects
None yet
Development

No branches or pull requests

1 participant