You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/02/01 11:36:11 UTC
[GitHub] [arrow] jaroszan opened a new pull request #9386: https://issues.apache.org/jira/browse/ARROW-11373
jaroszan opened a new pull request #9386:
URL: https://github.com/apache/arrow/pull/9386
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579553038
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
Before and after screenshots of the rendering, if it helps with review.
BEFORE:
<img width="745" alt="Screen Shot 2021-02-19 at 5 19 31 PM" src="https://user-images.githubusercontent.com/878798/108575787-9ef08f80-72d8-11eb-927d-21cc07cf32e1.png">
AFTER:
<img width="774" alt="Screen Shot 2021-02-19 at 5 18 21 PM" src="https://user-images.githubusercontent.com/878798/108575784-9c8e3580-72d8-11eb-91b7-426b9b570261.png">
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579554987
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
And here's me testing the example executes without exception:
```
>>> from pyarrow import csv
>>> import pyarrow as pa
>>> table = csv.read_csv(
... "tips.csv",
... convert_options=pa.csv.ConvertOptions(
... column_types={
... "total_bill": pa.decimal128(precision=10, scale=2),
... "tip": pa.decimal128(precision=10, scale=2),
... }
... ),
... )
>>> print(table)
pyarrow.Table
total_bill: decimal(10, 2)
tip: decimal(10, 2)
sex: string
smoker: string
day: string
time: string
size: int64
```
Note: It took me a while to find the dataset in question. Looks like it's in the pandas repo. A link to it from these docs would be nice.
https://raw.githubusercontent.com/pandas-dev/pandas/master/pandas/tests/io/data/csv/tips.csv
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579554987
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
And here's me testing the example executes without exception, and results in a table with `total_bill` & `tip` casted to `decimal `:
```
>>> from pyarrow import csv
>>> import pyarrow as pa
>>> table = csv.read_csv(
... "tips.csv",
... convert_options=pa.csv.ConvertOptions(
... column_types={
... "total_bill": pa.decimal128(precision=10, scale=2),
... "tip": pa.decimal128(precision=10, scale=2),
... }
... ),
... )
>>> print(table)
pyarrow.Table
total_bill: decimal(10, 2)
tip: decimal(10, 2)
sex: string
smoker: string
day: string
time: string
size: int64
```
Note: It took me a while to find the dataset in question. Looks like it's in the pandas repo. A link to it from these docs would be nice.
https://raw.githubusercontent.com/pandas-dev/pandas/master/pandas/tests/io/data/csv/tips.csv
PS. Ignore the comment in your email that said `import pyarrow as pa` was missing (I've since deleted it). The import was above this conversation -- my bad :(
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579553038
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
Before and after screenshots of the rendering, if it helps with review.
<img width="774" alt="Screen Shot 2021-02-19 at 5 18 21 PM" src="https://user-images.githubusercontent.com/878798/108575784-9c8e3580-72d8-11eb-91b7-426b9b570261.png">
<img width="745" alt="Screen Shot 2021-02-19 at 5 19 31 PM" src="https://user-images.githubusercontent.com/878798/108575787-9ef08f80-72d8-11eb-927d-21cc07cf32e1.png">
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
pitrou commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r568730716
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,16 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+
+ table = csv.read_csv('testdata.csv', convert_options=pa.csv.ConvertOptions(
+ column_types={
+ 's_name': pa.string(),
+ 's_start_date': pa.string(),
+ 'agg_percentile_bps': pa.decimal128(precision=38, scale=10),
+ }
+ ))
Review comment:
It would be better if the example was related to the example above, IMHO.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579552853
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,18 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+
+ import pyarrow as pa
+ import pyarrow.csv as csv
Review comment:
Missing: `import pyarrow as pa`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579553038
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
Before and after screenshots of the rendering, if it helps with review. Note that if you black format the example (screenshot 3), it won't be truncated as it currently is in the AFTER screenshot.
BEFORE:
<img width="745" alt="Screen Shot 2021-02-19 at 5 19 31 PM" src="https://user-images.githubusercontent.com/878798/108575787-9ef08f80-72d8-11eb-927d-21cc07cf32e1.png">
AFTER:
<img width="774" alt="Screen Shot 2021-02-19 at 5 18 21 PM" src="https://user-images.githubusercontent.com/878798/108575784-9c8e3580-72d8-11eb-91b7-426b9b570261.png">
BLACK FORMATTED:
<img width="787" alt="Screen Shot 2021-02-19 at 5 41 17 PM" src="https://user-images.githubusercontent.com/878798/108576268-2f7b9f80-72da-11eb-8f81-83fcb920722f.png">
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
jorisvandenbossche commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r568852511
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,16 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+
+ table = csv.read_csv('testdata.csv', convert_options=pa.csv.ConvertOptions(
+ column_types={
+ 's_name': pa.string(),
+ 's_start_date': pa.string(),
+ 'agg_percentile_bps': pa.decimal128(precision=38, scale=10),
+ }
+ ))
Review comment:
Specifically, you could maybe show to read the "total_bill" and "tip" columns as decimal?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
jorisvandenbossche commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r575303498
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
+ import pyarrow.csv as csv
+
+ table = csv.read_csv('tips.csv.gz', convert_options=pa.csv.ConvertOptions(
+ column_types={
+ 'total_bill': pa.decimal128(precision=10, scale=2),
+ 'tip': pa.decimal128(precision=10, scale=2),
+ 'sex': pa.string(),
+ 'smoker': pa.string(),
+ 'day': pa.string(),
+ 'time': pa.string(),
+ 'size': pa.int64()
Review comment:
I think `column_type` allows to specify the type for only a subset of the columns. So that might actually be useful to show in the example (eg only for total_bill/tip), otherwise readers might get the impression that they need to specify all columns)
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
Can you leave a blank line between the code block and the paragraph above? (restructuredtext formatting is quite strict about those details ..)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
jorisvandenbossche commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r568852511
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,16 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+
+ table = csv.read_csv('testdata.csv', convert_options=pa.csv.ConvertOptions(
+ column_types={
+ 's_name': pa.string(),
+ 's_start_date': pa.string(),
+ 'agg_percentile_bps': pa.decimal128(precision=38, scale=10),
+ }
+ ))
Review comment:
Specifically, you could maybe show to read the "total_bill" and "tip" columns as decimal?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] lidavidm closed pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
lidavidm closed pull request #9386:
URL: https://github.com/apache/arrow/pull/9386
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579554987
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
And here's me testing the example executes without exception, and results in a table with `total_bill` & `tip` casted to `decimal `:
```
>>> from pyarrow import csv
>>> import pyarrow as pa
>>> table = csv.read_csv(
... "tips.csv",
... convert_options=pa.csv.ConvertOptions(
... column_types={
... "total_bill": pa.decimal128(precision=10, scale=2),
... "tip": pa.decimal128(precision=10, scale=2),
... }
... ),
... )
>>> print(table)
pyarrow.Table
total_bill: decimal(10, 2)
tip: decimal(10, 2)
sex: string
smoker: string
day: string
time: string
size: int64
```
Note: It took me a while to find the dataset in question. Looks like it's in the pandas repo. A link to it from these docs would be nice.
https://raw.githubusercontent.com/pandas-dev/pandas/master/pandas/tests/io/data/csv/tips.csv
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579554987
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
And here's me testing the example executes without exception:
```
>>> from pyarrow import csv
>>> import pyarrow as pa
>>> table = csv.read_csv(
... "tips.csv",
... convert_options=pa.csv.ConvertOptions(
... column_types={
... "total_bill": pa.decimal128(precision=10, scale=2),
... "tip": pa.decimal128(precision=10, scale=2),
... }
... ),
... )
```
Note: It took me a while to find the dataset in question. Looks like it's in the pandas repo. A link to it from these docs would be nice.
https://raw.githubusercontent.com/pandas-dev/pandas/master/pandas/tests/io/data/csv/tips.csv
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579553038
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
Before and after screenshots of the rendering, if it helps with review. Note that if you black format the example (screenshot 3), it won't be truncated as it currently is in the AFTER screenshot.
That said, with the arrow sphinx theme applied, your example isn't truncated (screenshot 4). Perhaps the core devs/reviewers have thoughts on how they want code examples to be formatted.
Updated: The following alternative formatting passes Arrow's linting rules (`$ archery lint --python`). I would go with this formatting.
```
table = csv.read_csv('tips.csv.gz', convert_options=pa.csv.ConvertOptions(
column_types={
'total_bill': pa.decimal128(precision=10, scale=2),
'tip': pa.decimal128(precision=10, scale=2),
}
))
```
BEFORE:
<img width="745" alt="Screen Shot 2021-02-19 at 5 19 31 PM" src="https://user-images.githubusercontent.com/878798/108575787-9ef08f80-72d8-11eb-927d-21cc07cf32e1.png">
AFTER:
<img width="774" alt="Screen Shot 2021-02-19 at 5 18 21 PM" src="https://user-images.githubusercontent.com/878798/108575784-9c8e3580-72d8-11eb-91b7-426b9b570261.png">
BLACK FORMATTED:
<img width="787" alt="Screen Shot 2021-02-19 at 5 41 17 PM" src="https://user-images.githubusercontent.com/878798/108576268-2f7b9f80-72da-11eb-8f81-83fcb920722f.png">
WITH THEME:
<img width="750" alt="Screen Shot 2021-02-19 at 6 17 49 PM" src="https://user-images.githubusercontent.com/878798/108577653-01e52500-72df-11eb-8191-387c51d70926.png">
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579552853
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,18 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+
+ import pyarrow as pa
+ import pyarrow.csv as csv
Review comment:
Missing: `import pyarrow as pa`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] dianaclarke commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r579553038
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,22 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+ import pyarrow as pa
Review comment:
Before and after screenshots of the rendering, if it helps with review. Note that if you black format the example (screenshot 3), it won't be truncated as it currently is in the AFTER screenshot.
That said, with the arrow sphinx theme applied, your example isn't truncated (screenshot 4). Perhaps the core devs/reviewers have thoughts on how they want code examples to be formatted.
BEFORE:
<img width="745" alt="Screen Shot 2021-02-19 at 5 19 31 PM" src="https://user-images.githubusercontent.com/878798/108575787-9ef08f80-72d8-11eb-927d-21cc07cf32e1.png">
AFTER:
<img width="774" alt="Screen Shot 2021-02-19 at 5 18 21 PM" src="https://user-images.githubusercontent.com/878798/108575784-9c8e3580-72d8-11eb-91b7-426b9b570261.png">
BLACK FORMATTED:
<img width="787" alt="Screen Shot 2021-02-19 at 5 41 17 PM" src="https://user-images.githubusercontent.com/878798/108576268-2f7b9f80-72da-11eb-8f81-83fcb920722f.png">
WITH THEME:
<img width="750" alt="Screen Shot 2021-02-19 at 6 17 49 PM" src="https://user-images.githubusercontent.com/878798/108577653-01e52500-72df-11eb-8191-387c51d70926.png">
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #9386: https://issues.apache.org/jira/browse/ARROW-11373
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#issuecomment-770800309
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Thanks for opening a pull request!
Could you open an issue for this pull request on JIRA?
https://issues.apache.org/jira/browse/ARROW
Then could you also rename pull request title in the following format?
ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}
See also:
* [Other pull requests](https://github.com/apache/arrow/pulls/)
* [Contribution Guidelines - How to contribute patches](https://arrow.apache.org/docs/developers/contributing.html#how-to-contribute-patches)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou commented on a change in pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
pitrou commented on a change in pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#discussion_r568730716
##########
File path: docs/source/python/csv.rst
##########
@@ -75,7 +75,16 @@ Customized conversion
---------------------
To alter how CSV data is converted to Arrow types and data, you should create
-a :class:`ConvertOptions` instance and pass it to :func:`read_csv`.
+a :class:`ConvertOptions` instance and pass it to :func:`read_csv`::
+
+ table = csv.read_csv('testdata.csv', convert_options=pa.csv.ConvertOptions(
+ column_types={
+ 's_name': pa.string(),
+ 's_start_date': pa.string(),
+ 'agg_percentile_bps': pa.decimal128(precision=38, scale=10),
+ }
+ ))
Review comment:
It would be better if the example was related to the example above, IMHO.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#issuecomment-770821241
https://issues.apache.org/jira/browse/ARROW-11373
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] lidavidm commented on pull request #9386: ARROW-11373: [Python][Docs] Add example of specifying type for a column when reading csv file
Posted by GitBox <gi...@apache.org>.
lidavidm commented on pull request #9386:
URL: https://github.com/apache/arrow/pull/9386#issuecomment-791838356
I touched up the whitespace and merged this. Thanks @jaroszan!
(If you make a JIRA account, let us know and we can assign the issue to you there, too.)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org