Skip to content

DOC: Added note and example for pyarrow storage #53961

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
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5464,6 +5464,26 @@ The above example creates a partitioned dataset that may look like:
except OSError:
pass

.. note::

* The parquet representation of ``StringDtype`` is the same, regardless of the storage.
* The data will be read in accordance with the ``string_storage`` settings.

.. ipython:: python
:okwarning:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new examples should not warn

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phofl I removed the warning but now the build fails with
Sphinx parallel build error: RuntimeError: Non Expected warning in /home/runner/work/pandas/pandas/doc/source/user_guide/io.rst line 5485

This is not throwing any error while building the docs in local. Can you please help me out here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phofl little help here?


df1 = pd.DataFrame({"A": pd.array(['a', 'b'], dtype=pd.StringDtype("pyarrow"))})
df2 = pd.DataFrame({"A": pd.array(['a', 'b'], dtype=pd.StringDtype("python"))})
df1.to_parquet("test.parquet")
with pd.option_context("string_storage", "pyarrow"):
df3 = pd.read_parquet("test.parquet")
pd.testing.assert_frame_equal(df3, df1)
df2.to_parquet("test.parquet")
with pd.option_context("string_storage", "pyarrow"):
df4 = pd.read_parquet("test.parquet")
pd.testing.assert_frame_equal(df4, df1)


.. _io.orc:

ORC
Expand Down
5 changes: 5 additions & 0 deletions doc/source/user_guide/text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ or convert from existing pandas data:
s2
type(s2[0])

.. note::

* The parquet representation of ``StringDtype`` is the same, regardless of the storage.
* The data will be read in accordance with the ``string_storage`` settings.


.. _text.differences:

Expand Down