65 Commits
Author SHA1 Message Date
dawgandAlenkaF 05c1a4bf54 GH-34577 [Python] Expose eol and null_string csv WriteOptions (#46976)
### Rationale for this change

Expose remaining csv write options to pyarrow.

### What changes are included in this PR?

Adding `eol` and `null_string` to csv.WriteOptions.

### Are these changes tested?

Yes, testing of setters included.

### Are there any user-facing changes?

* GitHub Issue: #34577

Lead-authored-by: Martin Nowak <code@dawg.eu>
Co-authored-by: AlenkaF <frim.alenka@gmail.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
2026-09-09 13:27:13 +02:00
Vlad BorovtsovandAntoine Pitrou 3d6e138aef GH-22232: [C++][Python] Introduce optional default_column_type parameter (#47663)
### Rationale for this change

Add an optional default_column_type parameter to the CSV reading API (C++ and Python) to provide a fallback type when per-column types aren’t specified, improving schema consistency and complementing the existing column_types logic.

### What changes are included in this PR?

- c++: new convert option "default_column_type" to augment logic around column_types parameter
- 3 reader tests: DefaultColumnTypePartialDefault, DefaultColumnTypeAllStringsWithHeader, DefaultColumnTypeAllStringsNoHeader). The last two tests are inspired by https://github.com/pandas-dev/pandas/pull/62242 and https://github.com/pandas-dev/pandas/issues/57666
- python: corresponding changes to make cpp change consumable from python
- python: extended test_convert_options test - include. default_column_type
- python: added new test "test_default_column_type" which tests how the field impacts schema; also test implicitly verifies leading zero preservation 
- relevant documentation update for python component;

### Are these changes tested?

Yes. Existing and new tests are passing.

C++: 

    > [==========] Running 3 tests from 1 test suite.
    > [----------] Global test environment set-up.
    > [----------] 3 tests from ReaderTests
    > [ RUN      ] ReaderTests.DefaultColumnTypePartialDefault
    > [       OK ] ReaderTests.DefaultColumnTypePartialDefault (3 ms)
    > [ RUN      ] ReaderTests.DefaultColumnTypeAllStringsWithHeader
    > [       OK ] ReaderTests.DefaultColumnTypeAllStringsWithHeader (0 ms)
    > [ RUN      ] ReaderTests.DefaultColumnTypeAllStringsNoHeader
    > [       OK ] ReaderTests.DefaultColumnTypeAllStringsNoHeader (0 ms)
    > [----------] 3 tests from ReaderTests (4 ms total)
    > 
    > [----------] Global test environment tear-down
    > [==========] 3 tests from 1 test suite ran. (4 ms total)
    > [  PASSED  ] 3 tests.
    
    All:
    
    > [==========] 264 tests from 46 test suites ran. (452 ms total)
    > [  PASSED  ] 264 tests.

pyarrow:
New tests are passing. 

### Are there any user-facing changes?

I believe this change is backward compatible. Parameter is optional and its default value doesn't change the existing behavior; All the existing rests are passing. 

Maybe relevant: https://github.com/apache/arrow/issues/22232

Relates to https://github.com/apache/arrow/issues/47502
* GitHub Issue: #47502

* GitHub Issue: #22232

Lead-authored-by: Vlad Borovtsov <borovcov.vlad@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
2026-05-13 10:29:32 +02:00
618d5fbe84 GH-47389: [Python] CSV and JSON options lack a nice repr/str (#47397)
### Rationale for this change

CSV and JSON options lack a nice repr/str dunder method

### What changes are included in this PR?

Add both these methods

### Are these changes tested?

Will be once it's ready for review

### Are there any user-facing changes?

No
* GitHub Issue: #47389

Lead-authored-by: Nic Crane <thisisnic@gmail.com>
Co-authored-by: AlenkaF <frim.alenka@gmail.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
2026-03-25 09:38:36 +01:00
Ayush Bansal 37c87db36b GH-47575: [Python] add quoting_header option to pyarrow WriterOptions (#47610)
### Rationale for this change
Expose CSV writer option quoting_header for pyarrow. Addresses https://github.com/apache/arrow/issues/47575

### What changes are included in this PR?
Cython changes for parsing quoting_header option in a manner similar to quoting_style

### Are these changes tested?
Yes, added a unit test under test_csv.py

### Are there any user-facing changes?
Add QuotingStyle quoting_header option in WriteOptions for pyarrow

* GitHub Issue: #47575

Authored-by: Ayush Bansal <abansal1008@gmail.com>
Signed-off-by: AlenkaF <frim.alenka@gmail.com>
2025-09-23 06:31:08 +02:00
ChiLin ChiuandRaúl Cumplido 992bee2c83 GH-45619: [Python] Use f-string instead of string.format (#45629)
### Rationale for this change

See https://github.com/apache/arrow/issues/45619.

### What changes are included in this PR?

Refactor using f-string instead of `string.format`. But do not use f-string for following case,  `string.format` allows passing parameters, making the code more reusable.

https://github.com/apache/arrow/blob/0fbf9823542233c5f32c26534c34cc97ce3f0be2/python/pyarrow/parquet/core.py#L1624-L1695

### Are these changes tested?

Via CI.

### Are there any user-facing changes?

No.

* GitHub Issue: #45619

Lead-authored-by: Chilin Chiou <chilin.chiou@gmail.com>
Co-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
2025-05-12 14:34:49 +02:00
Xuchen PanandAkshay Subramanian 16c7f1a0bb GH-14932: [Python] Add python bindings for JSON streaming reader (#45084)
### Rationale for this change

The C++ arrow has a JSON streaming reader which is not exposed on the Python interface.

### What changes are included in this PR?

This PR is based on #33761. It adds the `open_json` method to open a streaming reader for a JSON file.

### Are these changes tested?

Yes

### Are there any user-facing changes?

Yes. A new `open_json` method has been added to the Python interface, located at `pyarrow.json.open_json`, and its parameters are the same as the `pyarrow.json.read_json`

* GitHub Issue: #14932

Lead-authored-by: pxc <panxuchen.pxc@alibaba-inc.com>
Co-authored-by: Akshay Subramanian <asubramanian@grailbio.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2025-02-06 14:47:52 +01:00
Antoine Pitrou d076c69e81 GH-38676: [Python] Fix potential deadlock when CSV reading errors out (#38713)
### Rationale for this change

A deadlock can happen in a C++ destructor in the following case:
* the C++ destructor is called from Python, holding the GIL
* the C++ destructor waits for a threaded task to finish
* the threaded task has invoked some Python code which is waiting to acquire the GIL

### What changes are included in this PR?

To reliably present such a deadlock, introduce `std::shared_ptr` and `std::unique_ptr` wrappers that release the GIL when deallocating the embedded pointer.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: #38676

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2023-11-15 16:15:42 +01:00
ca1a0eb2dd GH-37217: [Python] Add missing docstrings to Cython (#37218)
### Rationale for this change

The Cython 3.0.0 upgrade https://github.com/apache/arrow/pull/37097 is triggering numpydoc errors for these missing docstrings.

### What changes are included in this PR?

* Docstrings added to Cython functions that omitted them

### Are these changes tested?

Yes, locally.

### Are there any user-facing changes?

User-facing documentation is added.
* Closes: #37217

Lead-authored-by: Dane Pitkin <dane@voltrondata.com>
Co-authored-by: Dane Pitkin <48041712+danepitkin@users.noreply.github.com>
Co-authored-by: Alenka Frim <AlenkaF@users.noreply.github.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
2023-08-18 12:03:28 +09:00
Marco Edward Gorelli 1706b095d6 GH-31905: [DevTools] Add linting to Cython files (#14662)
* Closes: GH-31905

Authored-by: MarcoGorelli <>
Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>
2023-03-08 23:20:22 +01:00
eitsupi c2e8f253e6 MINOR: [Python][Docs] Fix typo (#34362)
### Rationale for this change

Fix the typo found in #34340 which copied from this file.

### What changes are included in this PR?

Minor typo fixes.

### Are these changes tested?

No. Minor documentation changes only.

### Are there any user-facing changes?

No.

Authored-by: SHIMA Tatsuya <ts1s1andn@gmail.com>
Signed-off-by: Alenka Frim <frim.alenka@gmail.com>
2023-02-27 19:11:09 +01:00
Frederick JansenandJoris Van den Bossche fb58d8940e GH-14755: [Python] Expose QuotingStyle to Python (#14722)
This exposes the QuotingStyle option to Python. I tested this with the v10 tag since I wasn't able to build the master branch for some reason.
I'm happy to use enums instead of strings. Both seem to be used in Python and I wasn't sure which one was preferred.

(no Jira ticket since I don't have an account and can't create one)

Lead-authored-by: Frederick Jansen <frederick.jansen@gmail.com>
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2022-12-05 18:17:05 +01:00
Bryce Mecum 0f91e684dd ARROW-15006: [Python][CI][Doc] Enable numpydoc check PR03 (#13983)
Adds an additional numypdoc check to CI (PR03) and fixes all corresponding violations. 

Note this does not fully resolve [ARROW-15006](https://issues.apache.org/jira/browse/ARROW-15006).

Authored-by: Bryce Mecum <petridish@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2022-10-20 09:41:24 +02:00
Kai Fricke 6ff522433b ARROW-17641: [python] Fix ParseOptions deserialization of invalid_row_handler (#14061)
Authored-by: Kai Fricke <kai@anyscale.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2022-09-08 09:14:22 +02:00
Raúl Cumplido b67e3c8ef1 ARROW-16062: [Python] Move libarrow_python include definitions to its own file
This PR moves all the `arrow/python` definitions to its own `libarrow_python.pxd` file as requested on ARROW-16062

Closes #12873 from raulcd/ARROW-16062

Authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2022-04-15 17:35:15 +02:00
Alenka Frim be45ec60ad ARROW-15432: [Python] Address CSV docstrings
This PR adds docstring examples to:
- `pyarrow.csv.write_csv`
- `pyarrow.csv.read_csv`
- `pyarrow.csv.ReadOptions` except `block_size`
- `pyarrow.csv.ParseOptions` except `invalid_row_handler`
- `pyarrow.csv.ConvertOptions`

Closes #12543 from AlenkaF/ARROW-15432

Authored-by: Alenka Frim <frim.alenka@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2022-03-29 11:24:27 +02:00
Sanjiban Sengupta 7c7abadd79 ARROW-15672: [C++] Enable CSV writer to control the field delimiter
This PR modifies the WriteOptions for CSV to allow changing the default delimiter.

Closes #12426 from sanjibansg/csv_delimiter

Authored-by: Sanjiban Sengupta <sanjiban.sg@gmail.com>
Signed-off-by: Yibo Cai <yibo.cai@arm.com>
2022-02-24 02:02:07 +00:00
e9e16c9da7 ARROW-14738: [Python][Doc] Make return types clickable
Closes #11726 from amol-/ARROW-14738

Lead-authored-by: Alessandro Molina <amol@turbogears.org>
Co-authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
2022-01-19 12:51:43 +01:00
Antoine Pitrou 11040609fc ARROW-15116: [Python] Expose invalid_row_handler for CSV reader
Closes #12012 from pitrou/ARROW-15116-py-invalid-row-handler

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-12-29 17:18:31 +01:00
Alessandro Molina 0dfe59223c ARROW-13637: [Python] Fix docstrings
Address all docstrings to make sure they pass `archery numpydoc --allow-rule PR01`

Closes #11245 from amol-/ARROW-13637

Authored-by: Alessandro Molina <amol@turbogears.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-10-04 11:44:40 +02:00
Weston PaceandAntoine Pitrou 59cc791eeb ARROW-13580: [C++] quoted_strings_can_be_null only applied to string columns
Allow quoted nulls if quoted_strings_can_be_null is true

Closes #10897 from westonpace/bugfix/ARROW-13580--c-quoted_strings_can_be_null-only-applied-to-s

Lead-authored-by: Weston Pace <weston.pace@gmail.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-08-30 19:56:27 +02:00
Antoine Pitrou e5b0957b2c ARROW-13421: [C++][Python] Add CSV convert option to change decimal point
Closes #10852 from pitrou/ARROW-13421-csv-decimal-point

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-08-03 13:41:13 +02:00
Alessandro Molina 082b11e9ec ARROW-13239: [Python] [Doc] Expose signatures in pyx modules
Closes #10684 from amol-/ARROW-13239

Authored-by: Alessandro Molina <amol@turbogears.org>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
2021-07-16 13:36:54 +02:00
David Li 6c8d30ea82 ARROW-13230: [Docs][Python] Add CSV writer docs
Closes #10658 from lidavidm/arrow-13230

Authored-by: David Li <li.davidm96@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
2021-07-07 12:20:11 -04:00
David Li 0ebed2b9c9 ARROW-12512: [C++][Python][Dataset] Create CSV writer class and add Datasets support
This refactors the CSV write support to expose an explicit CSV writer class, and adds Python bindings and Datasets support.

Closes #10230 from lidavidm/arrow-12512

Authored-by: David Li <li.davidm96@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-07-05 16:17:59 +02:00
Antoine Pitrou 99a68d4795 ARROW-10115: [C++] Add CSV option to treat quoted strings as always non-null
The option is only applicable to string and binary columns.

Closes #10503 from pitrou/ARROW-10115-csv-quoted-nulls

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-06-16 20:05:33 +02:00
Nate Clark 4d19225d57 ARROW-12995: [C++] Add validation to CSV options
Closes #10505 from n3world/ARROW-12995-Validate_csv_opts

Authored-by: Nate Clark <nate@neworld.us>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-06-16 12:58:39 +02:00
Nate ClarkandAntoine Pitrou 7540b9f705 ARROW-12661: [C++] Add ReaderOptions::skip_rows_after_names
Add a new csv reader option which allows the reader to skip rows after reading the column names from the csv.

Closes #10255 from n3world/ARROW-12661-skip_after_names

Lead-authored-by: Nate Clark <nate@neworld.us>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-06-07 17:51:41 +02:00
Yibo CaiandAntoine Pitrou 78e993bb8c ARROW-12240: [Python] Fix invalid-offsetof warning
arrow::csv::ConvertOptions has stl container data members which are
not guaranteed to be standard layout type. It causes invalid-offsetof
warning when compiled with clang-12.

This patch changes directly embedded CCSVConvertOptions to unique_ptr
to fix the issue. Parse and Read options are also updated.

Closes #10154 from cyb70289/12240-invalid-offsetof

Lead-authored-by: Yibo Cai <yibo.cai@arm.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-05-03 16:23:39 +02:00
Antoine Pitrou c65ffe3d9e ARROW-12482: [Doc][C++][Python] Mention CSVStreamingReader pitfalls with type inference
Users may be surprised that type inference is done on the first block, and values can fail converting afterwards.

Closes #10132 from pitrou/ARROW-12482-csv-streaming-doc

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-04-27 15:24:52 +02:00
David Li 7d233cb395 ARROW-8631: [C++][Python][Dataset] Add ReadOptions to CsvFileFormat, expose options to python
This adds ReadOptions to CsvFileFormat and exposes ReadOptions, ConvertOptions, and CsvFragmentScanOptions to Python.

ReadOptions was added to CsvFileFormat as its options can affect the discovered schema. For the block size, which does not need to be global, a field was added to CsvFragmentScanOptions.

Closes #9725 from lidavidm/arrow-8631

Authored-by: David Li <li.davidm96@gmail.com>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
2021-03-23 11:58:13 -04:00
Antoine Pitrou 79ae4f6db3 ARROW-8732: [C++] Add basic cancellation API
In this model, a StopSource is instantiated by the consumer, which passes a corresponding StopToken to producer API(s).

Closes #9528 from pitrou/ARROW-8732-cancel-v2

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-03-09 17:07:42 +01:00
Antoine Pitrou 59f9d2089b ARROW-10420: [C++] Refactor io and filesystem APIs to take an IOContext
The `io::IOContext` class allows passing various settings such as the MemoryPool used for allocation and the Executor for async methods.

Closes #9474 from pitrou/ARROW-10420-io-context

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
2021-02-25 21:17:33 -05:00
9a9baf6824 ARROW-2229: [C++][Python] Add WriteCsv functionality.
This offers possibly performance naive CSV writer with
limited options to keep the initial PR down.

Obvious potential improvements to this approach
are:

- Smarter casts for dictionaries
- Arena allocation for intermediate cast results

The implementation also means that for all primitive type
support we might have to fill in gaps in our cast function.

Closes #9504 from emkornfield/csv

Lead-authored-by: Micah Kornfield <emkornfield@gmail.com>
Co-authored-by: emkornfield <micahk@google.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: Micah Kornfield <micahk@google.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2021-02-25 20:15:54 +01:00
Weston PaceandBenjamin Kietzman e94ad8c643 ARROW-10183: [C++] Apply composable futures to CSV
Closes #9095 from westonpace/feature/arrow-10183-2

Lead-authored-by: Weston Pace <weston.pace@gmail.com>
Co-authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
2021-02-16 09:45:34 -05:00
Antoine Pitrou 97879eb970 ARROW-9761: [C/C++] Add experimental C stream inferface
The goal is to have a standardized ABI to communicate streams of homogeneous arrays or record batches (for example for database result sets).

The trickiest part is error reporting.  This proposal tries to strike a compromise between simplicity (an integer error code mapping to errno values) and expressivity (an optional description string for application-specific and context-specific details).

Closes #8052 from pitrou/ARROW-9761-c-array-stream

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2020-10-01 12:00:12 +02:00
Antoine Pitrou a4eb08d54e ARROW-9469: [Python] Make more objects weakrefable
By default, Cython extension classes (defined with "cdef class") don't have a weakref slot, so add one to all of them.

This adds just one memory word to each object, which IMHO is acceptable.

Closes #7758 from pitrou/ARROW-9469-py-weakrefable-objects

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
2020-07-29 12:24:36 +02:00
Krisztián Szűcs f25a014ab1 ARROW-7654: [Python] Ability to set column_types to a Schema in csv.ConvertOptions is undocumented
Closes #7594 from kszucs/ARROW-7654

Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2020-07-01 09:56:01 +02:00
Antoine Pitrou 16989513ac ARROW-9106: [Python] Allow specifying CSV file encoding
Also add a C++ InputStream wrapper that transforms data from the stream according to an arbitrary callable.

Closes #7456 from pitrou/ARROW-9106-csv-transcoding

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Wes McKinney <wesm@apache.org>
2020-06-25 09:24:29 -05:00
Wes McKinney 124db17bcd ARROW-9030: [Python] Remove pyarrow/compat.py, move some oft-used utility functions to pyarrow.lib
This is some routine scrubbing that deals with some remnants of the prior dual py2/3 codebase.

Closes #7421 from wesm/ARROW-9030

Authored-by: Wes McKinney <wesm@apache.org>
Signed-off-by: Wes McKinney <wesm@apache.org>
2020-06-12 21:36:22 -05:00
Antoine Pitrou 1325d139b7 ARROW-9101: [Doc][C++] Document encoding expected for CSV data
Closes #7407 from pitrou/ARROW-9101-document-csv-encoding

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Wes McKinney <wesm@apache.org>
2020-06-12 11:38:31 -05:00
Antoine Pitrou b69482523d ARROW-8711: [Python] Expose timestamp_parsers in csv.ConvertOptions
Closes #7223 from pitrou/ARROW-8711-py-csv-timestamp-parsing

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: François Saint-Jacques <fsaintjacques@gmail.com>
2020-06-03 08:27:17 -04:00
Benjamin KietzmanandNeal Richardson 8d5ca476d9 ARROW-7759: [C++][Dataset] Add CsvFileFormat
Closes #7033 from bkietz/7759-Add-CsvFileFormat-for-CSV

Lead-authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
2020-04-30 13:50:12 -04:00
Antoine Pitrou 18872a4441 ARROW-3410: [C++][Python] Add streaming CSV reader.
Only the serial version is implemented for now.

Closes #6764 from pitrou/ARROW-3410-streaming-csv

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: François Saint-Jacques <fsaintjacques@gmail.com>
2020-04-14 11:44:20 -04:00
Joris Van den Bossche acfcc5b3ef ARROW-7628: [Python] Clarify docs of csv reader skip_rows and nulls in strings
Closes #6463 from jorisvandenbossche/ARROW-7628-csv-doc and squashes the following commits:

19e6d3049d <Joris Van den Bossche> update phrasing
fdfbeb9857 <Joris Van den Bossche> ARROW-7628:  Clarify docs of csv reader skip_rows and nulls in strings

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: François Saint-Jacques <fsaintjacques@gmail.com>
2020-02-21 08:16:50 -05:00
Antoine Pitrou 412145b8a7 ARROW-5757: [Python] Remove Python 2.7 support
Part of the changes were done using [pyupgrade](https://github.com/asottile/pyupgrade).

Closes #6410 from pitrou/ARROW-5757-py2-goodbye and squashes the following commits:

f0f9f513b <Antoine Pitrou> Address review comments
561ac965c <Antoine Pitrou> ARROW-5757:  Remove Python 2.7 support

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
2020-02-12 21:37:59 -06:00
Antoine Pitrou bb96b7665c ARROW-7236: [C++] Add Result<T> APIs to arrow/csv
Closes #5936 from pitrou/ARROW-7236-csv-result-migration and squashes the following commits:

a49de2c69 <Antoine Pitrou> ARROW-7236:  Add Result<T> APIs to arrow/csv

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
2019-12-02 18:36:26 -06:00
Antoine Pitrou b71d280654 ARROW-3408: [C++] Add CSV option to automatically attempt dict encoding
This is tied to type inference, and only triggers on string or binary columns.
Each chunk is dict-encoded up to a certain cardinality, after which the whole
column falls back on plain encoding.

Closes #5785 from pitrou/ARROW-3408-csv-auto-dict-encode and squashes the following commits:

8d909fdcd <Antoine Pitrou> ARROW-3408:  Add CSV option to automatically attempt dict encoding

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
2019-11-07 10:48:56 -06:00
Krisztián Szűcs 8bbb297b18 ARROW-6655: [Python] Filesystem bindings for S3
- Add support for S3FileSystem in the python bindings.
- Fixed issue with reading all the content of an S3 object
- Introduce `minio_server` fixture for parametrized testing of all filesystem implementations
- Fixed s3fs parquet test and updated it to use minio_server fixture

Closes #5423 from kszucs/s3 and squashes the following commits:

384c96052 <Krisztián Szűcs> Resolve review comments
73e6625f9 <Krisztián Szűcs> S3Options
98bd91ad1 <Krisztián Szűcs> remove commented tests
db89859ca <Krisztián Szűcs> rename to s3fs
44784582a <Krisztián Szűcs> fix read() issue
c1df10b92 <Krisztián Szűcs> initialization in first use
192ab6547 <Krisztián Szűcs> flake8
f70f9fbd8 <Krisztián Szűcs> remove minio-client dependency
d399643dc <Krisztián Szűcs> simplify test suite
fee57a9a4 <Krisztián Szűcs> remove accidentally committed files
751cfd429 <Krisztián Szűcs> resolve a couple of review comments; enum workaround
45436f7b3 <Krisztián Szűcs> cython flake8
38dcb88d0 <Krisztián Szűcs> rat
c541b3e15 <Krisztián Szűcs> comment left
098048a8a <Krisztián Szűcs> more compat
00340ed4c <Krisztián Szűcs> fixture error handling
2be25ce29 <Krisztián Szűcs> auto initialize s3 on import
88e0c9f79 <Krisztián Szűcs> py2 compat
8585a6085 <Krisztián Szűcs> py2 compat
d37228711 <Krisztián Szűcs> install minio in the conda-toolchain build
041cad42a <Krisztián Szűcs> executable flag
fb0f2813a <Krisztián Szűcs> travis minio install script
8cbe0eeef <Krisztián Szűcs> travis osx
72e56a68f <Krisztián Szűcs> enable S3 in travis python builds
7800c75d8 <Krisztián Szűcs> appveyor flag
7daf5668d <Krisztián Szűcs> fix syntax error in travis script
68eb59161 <Krisztián Szűcs> enable PYARROW_WITH_S3 on appveyor
2cb19d1ff <Krisztián Szűcs> conditional import of test dependencies
efa05d28e <Krisztián Szűcs> use minio for dask.s3fs test too
f25ae5aed <Krisztián Szűcs> travis
9042c7e4c <Krisztián Szűcs> use S3FS_DIR
9ce7180d1 <Krisztián Szűcs> cmake format; fix orc cimport
45a2a17ba <Krisztián Szűcs> docstrings
c0b91621e <Krisztián Szűcs> test requirements; flake8
44aedfd10 <Krisztián Szűcs> stat test
a343950e2 <Krisztián Szűcs> testing suite
1551b525c <Krisztián Szűcs> wip
dd41d21c2 <Krisztián Szűcs> imports
5200af16f <Krisztián Szűcs> s3 filesystem bindings

Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2019-10-05 11:47:17 +02:00
Antoine Pitrou beea8f9398 ARROW-6231: [C++] Allow generating CSV column names
Add an option that, if enabled, will autogenerate column names
for the target table rather than read them from the CSV file.

Closes #5206 from pitrou/ARROW-6231-autogenerate-column-names and squashes the following commits:

cc7fdc699 <Antoine Pitrou> ARROW-6231:  Allow generating CSV column names

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: François Saint-Jacques <fsaintjacques@gmail.com>
2019-08-30 12:33:53 -04:00
Antoine Pitrou 93688e8c1f ARROW-5977: [C++] [Python] Allow specifying which columns to include
If the `include_columns` option is not empty:
- columns are included in that order
- columns not in `include_columns` are ignored
- columns in `include_columns` but not in the CSV file produce a null column

Closes #5026 from pitrou/ARROW-5977-csv-include-columns and squashes the following commits:

0f198ef0b <Antoine Pitrou> ARROW-5977:   Allow specifying which columns to include

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
2019-08-12 14:05:54 +02:00