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(python): Add note on hash stability and mention polars-hash #12496

Merged
merged 4 commits into from
Nov 16, 2023
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
1 change: 1 addition & 0 deletions docs/user-guide/expressions/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,4 @@ That's all you need to know to get started. Take a look at this [repo](https://g
Here is a curated (non-exhaustive) list of community implemented plugins.

- [polars-business](https://github.com/MarcoGorelli/polars-business) Polars extension offering utilities for business day operations
- [polars-hash](https://github.com/ion-elgreco/polars-hash) Stable non-cryptographic and cryptographic hashing functions for Polars
6 changes: 6 additions & 0 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -9485,6 +9485,12 @@ def hash_rows(
seed_3
Random seed parameter. Defaults to `seed` if not set.

Notes
-----
This implementation of :func:`hash_rows` does not guarantee stable results
across different Polars versions. Its stability is only guaranteed within a
single version.

Examples
--------
>>> df = pl.DataFrame(
Expand Down
8 changes: 8 additions & 0 deletions py-polars/polars/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5381,6 +5381,14 @@ def hash(
seed_3
Random seed parameter. Defaults to `seed` if not set.

Notes
-----
This implementation of :func:`rows` does not guarantee stable results
across different Polars versions. Its stability is only guaranteed within a
single version.
For use-cases where stability across versions is required, you can use
Copy link
Member

Choose a reason for hiding this comment

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

I think it is good to add the plugin to the list of plugins, but I want to refrain from pointing to plugins in the docstrings we didn't write.

Copy link
Member

Choose a reason for hiding this comment

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

All right will revert that part 👍

the `polars-hash <https://github.com/ion-elgreco/polars-hash>`_ plugin.

Examples
--------
>>> df = pl.DataFrame(
Expand Down
6 changes: 6 additions & 0 deletions py-polars/polars/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -5800,6 +5800,12 @@ def hash(
seed_3
Random seed parameter. Defaults to `seed` if not set.

Notes
-----
This implementation of :func:`hash` does not guarantee stable results
across different Polars versions. Its stability is only guaranteed within a
single version.

Examples
--------
>>> s = pl.Series("a", [1, 2, 3])
Expand Down