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

avoid private _utils import #23

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

MarcoGorelli
Copy link
Contributor

@MarcoGorelli MarcoGorelli commented Mar 14, 2024

_utils is private and can change without warning

But I don't think you need this anyway, as register_expression calls parse_as_expression on its inputs anyway

@MarcoGorelli MarcoGorelli force-pushed the avoid-private-import branch from 406f9b7 to b66f7fb Compare March 14, 2024 12:37
@MarcoGorelli MarcoGorelli marked this pull request as ready for review March 14, 2024 12:38
Copy link
Owner

@ion-elgreco ion-elgreco left a comment

Choose a reason for hiding this comment

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

Thanks Marco! Just left one comment

@@ -158,10 +148,9 @@ def to_coords(self) -> pl.Expr:

def from_coords(self, len: int | str | pl.Expr = 12) -> pl.Expr:
"""Takes Struct with latitude, longitude as input and returns utf8 hash using geohash."""
len_expr = wrap_expr(parse_as_expression(len))
Copy link
Owner

Choose a reason for hiding this comment

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

This one I believe still needs to used because input can also be int or str,

Copy link
Contributor Author

@MarcoGorelli MarcoGorelli Mar 14, 2024

Choose a reason for hiding this comment

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

wouldn't Polars take care of this here

https://github.com/pola-rs/polars/blob/b957d53aa6d835e5c456bc98943cde960658633d/py-polars/polars/expr/expr.py#L9680-L9683

?

so long as self is an expression, I think it should be fine

Copy link
Owner

Choose a reason for hiding this comment

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

Ah I did not know that :) that's nice!

@ion-elgreco ion-elgreco merged commit 03c38b4 into ion-elgreco:main Mar 14, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants