Skip to content

Commit

Permalink
changes from sdg comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam Brannigan committed Oct 9, 2023
1 parent 0661da2 commit 1f938b2
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/_build/API_REFERENCE_LINKS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ python:
read_json: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_json.html
write_json: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.DataFrame.write_json.html
read_ipc: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_ipc.html
read_parquet: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_parquet.html
min: https://pola-rs.github.io/polars/py-polars/html/reference/series/api/polars.Series.min.html
max: https://pola-rs.github.io/polars/py-polars/html/reference/series/api/polars.Series.max.html
value_counts: https://pola-rs.github.io/polars/py-polars/html/reference/expressions/api/polars.Expr.value_counts.html
Expand Down
5 changes: 5 additions & 0 deletions docs/src/python/user-guide/io/cloud-storage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# --8<-- [start:setup]
import polars as pl

# --8<-- [end:setup]

"""
# --8<-- [start:read_parquet]
import polars as pl
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/io/cloud-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Polars can read and write to AWS S3, Azure Blob Storage and Google Cloud Storage. The API is the same for all three storage providers.

To read from cloud storage, additional dependencies may be needed depending on the use case and cloud storage provider:

=== ":fontawesome-brands-python: Python"

```shell
Expand Down
6 changes: 4 additions & 2 deletions docs/user-guide/io/csv.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# CSV

## Read & write
## Read

Reading a CSV file should look familiar:

{{code_block('user-guide/io/csv','read',['read_csv'])}}
{{code_block
('user-guide/io/csv','read',['read_csv'])}}

## Write
Writing a CSV file is similar with the `write_csv` function:

{{code_block('user-guide/io/csv','write',['write_csv'])}}
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/io/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $ pip install connectorx

#### ADBC

ADBC (Arrow Database Connectivity) is a new engine supported by the Apache Arrow project.
ADBC (Arrow Database Connectivity) is an engine supported by the Apache Arrow project. ADBC aims to be both an API standard for connecting to databases and libraries implementing this standard in a range of languages.

It is still early days for ADBC so support for different databases is still limited. At present drivers for ADBC are only available for [Postgres and SQLite](https://arrow.apache.org/adbc/0.1.0/driver/cpp/index.html). To install ADBC you need to install the driver for your database. For example to install the driver for SQLite you run

Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/io/json_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Polars can read an ND-JSON file into a `DataFrame` using the `read_ndjson` funct

{{code_block('user-guide/io/json-file','write',['write_json','write_ndjson'])}}

## Scan NDJSON
## Scan

`Polars` allows you to _scan_ a JSON input **only for newline delimited json**. Scanning delays the actual parsing of the
file and instead returns a lazy computation holder called a `LazyFrame`.
Expand Down
1 change: 0 additions & 1 deletion docs/user-guide/io/parquet.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ For reading a Parquet file from a cloud storage provider, see [Cloud storage](cl

{{code_block('user-guide/io/parquet','write',['write_parquet'])}}

For writing a Parquet file to a cloud storage provider, see [Cloud storage](cloud-storage.md/#writing-to-cloud-storage).

## Scan

Expand Down
14 changes: 4 additions & 10 deletions py-polars/polars/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,21 +409,15 @@ def set_auto_structify(cls, active: bool | None = False) -> type[Config]:
... out = df.select(pl.all())
...
>>> out
shape: (10, 1)
shape: (3, 1)
┌───────────┐
│ v │
│ --- │
│ struct[2] │
╞═══════════╡
│ {0,10} │
│ {1,11} │
│ {2,12} │
│ {3,13} │
│ … │
│ {6,16} │
│ {7,17} │
│ {8,18} │
│ {9,19} │
│ {1,4} │
│ {2,5} │
│ {3,6} │
└───────────┘
"""
Expand Down

0 comments on commit 1f938b2

Please sign in to comment.