Skip to content

Commit

Permalink
docs(python): Improve example in IO plugins user guide (pola-rs#21146)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Harbeck <[email protected]>
  • Loading branch information
henryharbeck and Henry Harbeck authored Feb 9, 2025
1 parent b50f758 commit faad12f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/source/user-guide/plugins/io_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -174,19 +174,19 @@ shape: (4, 4)
│ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ str ┆ str ┆ str │
╞═════╪═════╪═════╪═════╡
│ 1 ┆ 911
2 ┆ 10 ┆ 2 ┆ 122
311 ┆ 3 ┆ 3
42 ┆ 4 ┆ 4 │
│ 1 ┆ 234
9 ┆ 10 ┆ 11 ┆ 2
12 ┆ 3 ┆ 4
1122 ┆ 3 ┆ 4 │
└─────┴─────┴─────┴─────┘
shape: (2, 2)
┌─────┬─────┐
│ a ┆ b │
│ --- ┆ --- │
│ str ┆ str │
╞═════╪═════╡
│ 1 ┆ 9
2 ┆ 10 │
│ 1 ┆ 2
9 ┆ 10 │
└─────┴─────┘
```

Expand Down

0 comments on commit faad12f

Please sign in to comment.