DONT-MERGE GSOC26: feat: export from_pyarrow as top-level function and add docstring example#474
Conversation
|
Is this PR intended as a submission for Google Summer of Code? If so, see relevant notes from our guidelines:
|
|
Thank you for the guidance! I've renamed the PR and converted it to draft as per the GSoC guidelines. This is indeed intended as a GSoC 2026 contribution. |
| >>> import nested_pandas as npd | ||
| >>> import pyarrow as pa | ||
| >>> table = pa.table({"a": [1, 2, 3], "b": ["x", "y", "z"]}) | ||
| >>> nf = npd.from_pyarrow(table) |
There was a problem hiding this comment.
| >>> nf = npd.from_pyarrow(table) | |
| >>> npd.from_pyarrow(table) |
The docstring should show the output of the interesting call.
There was a problem hiding this comment.
Done! Removed nf = and added the expected output to the docstring.
| -------- | ||
| >>> import nested_pandas as npd | ||
| >>> import pyarrow as pa | ||
| >>> table = pa.table({"a": [1, 2, 3], "b": ["x", "y", "z"]}) |
There was a problem hiding this comment.
Use test data that contains some nested fields, to better showcase the feature.
There was a problem hiding this comment.
Done Updated the example to use nested astronomical data with obj_id and nested time/flux fields
| from ._version import __version__ | ||
| from .nestedframe import NestedFrame | ||
| from .nestedframe.io import read_parquet | ||
| from .nestedframe.io import read_parquet, from_pyarrow |
There was a problem hiding this comment.
This should also be exposed on the API Reference I/O section of the nested-pandas documentation.
docs/reference/nestedframe.rst
There was a problem hiding this comment.
Added from_pyarrow to the I/O section in docs/reference/nestedframe.rst
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #474 +/- ##
=======================================
Coverage 96.03% 96.03%
=======================================
Files 20 20
Lines 2247 2247
=======================================
Hits 2158 2158
Misses 89 89 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Click here to view all benchmarks. |
Fixes #432
Changes
from_pyarrowto the top-level__init__.pyimports so it can be used asnpd.from_pyarrow()from_pyarrowto__all__from_pyarrowinio.pyTesting
All 412 existing tests pass with no failures.