6 Commits
Author SHA1 Message Date
Alenka Frim fe298b424f GH-49628: [Python][Interchange protocol] Suppress warnings for pandas 4.0.0 and update docs (#49630)
### Rationale for this change
Pandas is moving the dataframe interchange protocol out of the repo in the next major release (4.0.0).

### What changes are included in this PR?
Filterwarnings are added and the pandas example is removed from the interchange documentation.

### Are these changes tested?
Yes, via CI.

### Are there any user-facing changes?
No.

* GitHub Issue: #49628

Authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
2026-04-07 11:02:15 +02:00
Alenka Frimandtadeja 12cdb09e32 GH-28859: [Doc][Python] Use only code-block directive and set up doctest for the python user guide (#48619)
### Rationale for this change

In many places in the Python User Guide the code exampels are written with IPython directive (elsewhere code-block is used). IPython directives are converted to IPython format (`In` and `Out` during the doc build). This can lead to slower builds.

### What changes are included in this PR?

IPython directives are converted to runnable code-block (with `>>>` and `...`) and pytest doctest support for `.rst` files is added to the `conda-python-docs` CI job. This means the code in the Python User Guide is tested separately to the building  of the documentation.

### Are these changes tested?

Yes, with the CI.

### Are there any user-facing changes?

Changes to the Python User Guide examples will have to be tested with `pytest --doctest-glob='*.rst' docs/source/python/file.rst`

* GitHub Issue: #28859

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: tadeja <tadeja@users.noreply.github.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
2026-01-30 09:09:33 +01:00
6c326db6a5 GH-33984: [C++][Python] DLPack implementation for Arrow Arrays (producer) (#38472)
### Rationale for this change

DLPack is selected for Array API protocol so it is important to have it implemented for Arrow/PyArrow Arrays also. This is possible for primitive type arrays (int, uint and float) with no validity buffer. Device support is not in scope of this PR (CPU only). 

### What changes are included in this PR?

- `ExportArray` and `ExportDevice` methods on Arrow C++ Arrays
- `__dlpack__` method on the base PyArrow Array class exposing `ExportArray` method
-  `__dlpack_device__` method on the base PyArrow Array class exposing `ExportDevice` method

### Are these changes tested?

Yes, tests are added to `dlpack_test.cc` and `test_array.py`.

### Are there any user-facing changes?

No.

* Closes: #33984

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2023-12-19 19:58:29 +01:00
Josh SorefandSutou Kouhei 3531396803 GH-38950: [Docs] Fix spelling (#38951)
### Rationale for this change

### What changes are included in this PR?

Spelling fixes to docs/

### Are these changes tested?

### Are there any user-facing changes?

* Closes: #38950

Lead-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2023-12-01 18:33:09 +01:00
Will Jones d68f8e2164 GH-35531: [Python] C Data Interface PyCapsule Protocol (#37797)
### Rationale for this change

### What changes are included in this PR?

* A new specification for Arrow PyCapsules and related dunder methods
* Implementing the dunder methods for `DataType`, `Field`, `Schema`, `Array`, `RecordBatch`, `Table`, and `RecordBatchReader`.

### Are these changes tested?

Yes, I've added various roundtrip tests for each of the types.

### Are there any user-facing changes?

This introduces some new APIs and documents them.

* Closes: #34031
* Closes: #35531

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2023-10-18 13:44:50 +02:00
Alenka FrimandJoris Van den Bossche 1d75816204 GH-33980: [Docs][Python] Document DataFrame Interchange Protocol implementation and usage (#35835)
_edit: just added something_
* Closes: #33980

Lead-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2023-06-07 14:02:08 +02:00