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:
us...@infra.apache.org


Reply via email to