jorisvandenbossche commented on a change in pull request #12543:
URL: https://github.com/apache/arrow/pull/12543#discussion_r831164514
##########
File path: python/pyarrow/_csv.pyx
##########
@@ -121,6 +121,59 @@ cdef class ReadOptions(_Weakrefable):
encoding : str, optional (default 'utf8')
The character encoding of the CSV data. Columns that cannot
decode using this encoding can still be read as Binary.
+
+ Example
+ -------
+
+ Defining an example file from bytes object:
+
+ >>> import io
+ >>> s = b'''1,2,3
+ ... Flamingo,2,2022-03-01
+ ... Horse,4,2022-03-02
+ ... Brittle stars,5,2022-03-03
+ ... Centipede,100,2022-03-04'''
Review comment:
I think if you do include the "print", I would use explicit newlines
(`\n`) in `s`, so that this becomes a one-liner (and avoids making the example
a lot longer).
Or, if you keep the multi-line string as in your example above, I think you
can also leave out the "print" call.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]