Skip to content

Commit

Permalink
docs(python): Mention stream position issue in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihe774 committed Jul 10, 2024
1 parent 366c935 commit adc94c0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions py-polars/polars/io/avro.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def read_avro(
Path to a file or a file-like object (by "file-like object" we refer to objects
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance).
For file-like objects, stream position may not be updated after reading.
columns
Columns to select. Accepts a list of column indices (starting at zero) or a list
of column names.
Expand Down
2 changes: 2 additions & 0 deletions py-polars/polars/io/csv/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def read_csv(
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance). If `fsspec` is installed, it will be used
to open remote files.
For file-like objects, stream position may not be updated after reading.
has_header
Indicate if the first row of the dataset is a header or not. If set to False,
column names will be autogenerated in the following format: `column_x`, with
Expand Down Expand Up @@ -646,6 +647,7 @@ def read_csv_batched(
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance). If `fsspec` is installed, it will be used
to open remote files.
For file-like objects, stream position may not be updated after reading.
has_header
Indicate if the first row of the dataset is a header or not. If set to False,
column names will be autogenerated in the following format: `column_x`, with
Expand Down
3 changes: 3 additions & 0 deletions py-polars/polars/io/ipc/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def read_ipc(
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance). If `fsspec` is installed, it will be used
to open remote files.
For file-like objects, stream position may not be updated after reading.
columns
Columns to select. Accepts a list of column indices (starting at zero) or a list
of column names.
Expand Down Expand Up @@ -199,6 +200,7 @@ def read_ipc_stream(
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance). If `fsspec` is installed, it will be used
to open remote files.
For file-like objects, stream position may not be updated after reading.
columns
Columns to select. Accepts a list of column indices (starting at zero) or a list
of column names.
Expand Down Expand Up @@ -287,6 +289,7 @@ def read_ipc_schema(source: str | Path | IO[bytes] | bytes) -> dict[str, DataTyp
Path to a file or a file-like object (by "file-like object" we refer to objects
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance).
For file-like objects, stream position may not be updated after reading.
Returns
-------
Expand Down
1 change: 1 addition & 0 deletions py-polars/polars/io/json/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def read_json(
Path to a file or a file-like object (by "file-like object" we refer to objects
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance).
For file-like objects, stream position may not be updated after reading.
schema : Sequence of str, (str,DataType) pairs, or a {str:DataType,} dict
The DataFrame schema may be declared in several ways:
Expand Down
1 change: 1 addition & 0 deletions py-polars/polars/io/ndjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def read_ndjson(
Path to a file or a file-like object (by "file-like object" we refer to objects
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance).
For file-like objects, stream position may not be updated after reading.
schema : Sequence of str, (str,DataType) pairs, or a {str:DataType,} dict
The DataFrame schema may be declared in several ways:
Expand Down
2 changes: 2 additions & 0 deletions py-polars/polars/io/parquet/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def read_parquet(
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance). If the path is a directory, files in that
directory will all be read.
For file-like objects, stream position may not be updated after reading.
columns
Columns to select. Accepts a list of column indices (starting at zero) or a list
of column names.
Expand Down Expand Up @@ -273,6 +274,7 @@ def read_parquet_schema(source: str | Path | IO[bytes] | bytes) -> dict[str, Dat
Path to a file or a file-like object (by "file-like object" we refer to objects
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance).
For file-like objects, stream position may not be updated after reading.
Returns
-------
Expand Down
2 changes: 2 additions & 0 deletions py-polars/polars/io/spreadsheet/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def read_excel(
Path to a file or a file-like object (by "file-like object" we refer to objects
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance).
For file-like objects, stream position may not be updated after reading.
sheet_id
Sheet number(s) to convert (set `0` to load all sheets as DataFrames) and
return a `{sheetname:frame,}` dict. (Defaults to `1` if neither this nor
Expand Down Expand Up @@ -383,6 +384,7 @@ def read_ods(
Path to a file or a file-like object (by "file-like object" we refer to objects
that have a `read()` method, such as a file handler like the builtin `open`
function, or a `BytesIO` instance).
For file-like objects, stream position may not be updated after reading.
sheet_id
Sheet number(s) to convert, starting from 1 (set `0` to load *all* worksheets
as DataFrames) and return a `{sheetname:frame,}` dict. (Defaults to `1` if
Expand Down

0 comments on commit adc94c0

Please sign in to comment.