From faad12f7277751006e3faebf0fffb1f6bf9aa7e7 Mon Sep 17 00:00:00 2001 From: Henry Harbeck <59268910+henryharbeck@users.noreply.github.com> Date: Sun, 9 Feb 2025 18:27:47 +1000 Subject: [PATCH] docs(python): Improve example in IO plugins user guide (#21146) Co-authored-by: Henry Harbeck --- docs/source/user-guide/plugins/io_plugins.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/user-guide/plugins/io_plugins.md b/docs/source/user-guide/plugins/io_plugins.md index 1e176a5214f1..11fc6bff415f 100644 --- a/docs/source/user-guide/plugins/io_plugins.md +++ b/docs/source/user-guide/plugins/io_plugins.md @@ -124,7 +124,7 @@ def my_scan_csv(csv_str: str) -> pl.LazyFrame: break rows.append(row) - df = pl.from_records(rows, schema=schema) + df = pl.from_records(rows, schema=schema, orient="row") n_rows -= df.height # If we would make a performant reader, we would not read these @@ -139,7 +139,7 @@ def my_scan_csv(csv_str: str) -> pl.LazyFrame: yield df - return register_io_source(callable=source_generator, schema=schema) + return register_io_source(io_source=source_generator, schema=schema) ``` ### Taking it for a (very slow) spin @@ -174,10 +174,10 @@ shape: (4, 4) │ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ str ┆ str ┆ str │ ╞═════╪═════╪═════╪═════╡ -│ 1 ┆ 9 ┆ 1 ┆ 1 │ -│ 2 ┆ 10 ┆ 2 ┆ 122 │ -│ 3 ┆ 11 ┆ 3 ┆ 3 │ -│ 4 ┆ 2 ┆ 4 ┆ 4 │ +│ 1 ┆ 2 ┆ 3 ┆ 4 │ +│ 9 ┆ 10 ┆ 11 ┆ 2 │ +│ 1 ┆ 2 ┆ 3 ┆ 4 │ +│ 1 ┆ 122 ┆ 3 ┆ 4 │ └─────┴─────┴─────┴─────┘ shape: (2, 2) ┌─────┬─────┐ @@ -185,8 +185,8 @@ shape: (2, 2) │ --- ┆ --- │ │ str ┆ str │ ╞═════╪═════╡ -│ 1 ┆ 9 │ -│ 2 ┆ 10 │ +│ 1 ┆ 2 │ +│ 9 ┆ 10 │ └─────┴─────┘ ```