Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix some warnings during docs build #19848

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
# --8<-- [end:stringcache-categorical-comparison-physical]

# --8<-- [start:concatenating-categoricals]
import warnings

from polars.exceptions import CategoricalRemappingWarning

male_bears = pl.DataFrame(
{
"species": ["Polar", "Brown", "Panda"],
Expand All @@ -130,7 +134,10 @@
schema_overrides={"species": pl.Categorical},
)

bears = pl.concat([male_bears, female_bears], how="vertical")
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=CategoricalRemappingWarning)
Copy link
Collaborator

@rodrigogiraoserrao rodrigogiraoserrao Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this (setting the filter) is still needed? 😪

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bears = pl.concat([male_bears, female_bears], how="vertical")

print(bears)
# --8<-- [end:concatenating-categoricals]

Expand Down
10 changes: 6 additions & 4 deletions docs/source/user-guide/expressions/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

The data type `Struct` is a composite data type that can store multiple fields in a single column.

??? tip "Python analogy" For Python users, the data type `Struct` is kind of like a Python
dictionary. Even better, if you are familiar with Python typing, you can think of the data type
`Struct` as `typing.TypedDict`.
!!! tip "Python analogy"

For Python users, the data type `Struct` is kind of like a Python
dictionary. Even better, if you are familiar with Python typing, you can think of the data type
`Struct` as `typing.TypedDict`.

In this page of the user guide we will see situations in which the data type `Struct` arises, we
will understand why it does arise, and we will see how to work with `Struct` values.
Expand Down Expand Up @@ -151,7 +153,7 @@ Now, to compute the values of the Ackermann function on those arguments, we star
`Struct` with fields `m` and `n` and then use the function `map_elements` to apply the function
`ack` to each value:

{{code_block('user-guide/expressions/structs','struct-ack',[], ['map_elements'], ['apply'])}}
{{code_block('user-guide/expressions/structs','struct-ack',[], ['map_elements'], [])}}

```python exec="on" result="text" session="expressions/structs"
--8<-- "python/user-guide/expressions/structs.py:struct-ack"
Expand Down
10 changes: 5 additions & 5 deletions docs/source/user-guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ The opt-in features are:
- `dtype-categorical`
- `dtype-struct`
- `lazy` - Lazy API:
- `regex` - Use regexes in [column selection](crate::lazy::dsl::col).
- `regex` - Use regexes in column selection.
- `dot_diagram` - Create dot diagrams from lazy logical plans.
- `sql` - Pass SQL queries to Polars.
- `streaming` - Be able to process datasets that are larger than RAM.
Expand Down Expand Up @@ -228,8 +228,8 @@ The opt-in features are:
- `dataframe_arithmetic` - Arithmetic between dataframes and other dataframes or series.
- `partition_by` - Split into multiple dataframes partitioned by groups.
- Series/expression operations:
- `is_in` - [Check for membership in series](crate::chunked_array::ops::IsIn)
- `zip_with` - [Zip two `Series` / `ChunkedArray`s](crate::chunked_array::ops::ChunkZip)
- `is_in` - Check for membership in Series.
- `zip_with` - Zip two `Series` / `ChunkedArray`s.
- `round_series` - round underlying float types of series.
- `repeat_by` - Repeat element in an array a number of times specified by another array.
- `is_first_distinct` - Check if element is first unique value.
Expand All @@ -239,10 +239,10 @@ The opt-in features are:
- `concat_str` - Concatenate string data in linear time.
- `reinterpret` - Utility to reinterpret bits to signed/unsigned.
- `take_opt_iter` - Take from a series with `Iterator<Item=Option<usize>>`.
- `mode` - [Return the most frequently occurring value(s)](crate::chunked_array::ops::ChunkUnique::mode).
- `mode` - Return the most frequently occurring value(s).
- `cum_agg` - `cum_sum`, `cum_min`, and `cum_max`, aggregations.
- `rolling_window` - rolling window functions, like `rolling_mean`.
- `interpolate` - [interpolate `None` values](crate::chunked_array::ops::Interpolate).
- `interpolate` - Interpolate `None` values.
- `extract_jsonpath` - [Run `jsonpath` queries on `StringChunked`](https://goessner.net/articles/JsonPath/).
- `list` - List utils:
- `list_gather` - take sublist by multiple indices.
Expand Down
Loading