DEPR: fix stacklevel for DataFrame(mgr) deprecation
State: closed

Follow-up on https://github.com/pandas-dev/pandas/pull/52419. To ensure end users don't see this warning (unless they would be passing a manager themselves), but only libraries see them in their tests.

See https://github.com/pandas-dev/pandas/pull/52419#issuecomment-1770215326 for context.

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Warnings
description: Warnings that appear or should be added to pandas

Comments:
```
FAILED pandas/tests/io/test_orc.py::test_orc_reader_empty - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_reader_basic - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_reader_decimal - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_reader_date_low - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_reader_date_high - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_reader_snappy_compressed - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_roundtrip_file - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_roundtrip_bytesio - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_dtype_backend_pyarrow - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_dtype_backend_numpy_nullable - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
FAILED pandas/tests/io/test_orc.py::test_orc_uri_path - AssertionError: Warning not set with correct stacklevel. File where warning is raised: /Users/runner/work/pandas/pandas/pandas/io/orc.py != /Users/runner/work/pandas/pandas/pandas/tests/io/test_orc.py. Warning message: Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.
```

As mentioned on the issue, I updated this to use `stacklevel=1` for now (to avoid the warnings from pyarrrow's cython in user code). Once there is a release of pyarrow with the fix, we can change that to `stacklevel=2`. 

And the tests are all passing now.
Any other comments here?