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

Use correct package for Polars typing #25

Merged
merged 2 commits into from
Oct 30, 2024
Merged
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
6 changes: 5 additions & 1 deletion polars_distance/polars_distance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

import polars as pl
from pathlib import Path
from polars.type_aliases import IntoExpr, PolarsDataType
from polars.plugins import register_plugin_function
from ._internal import __version__ as __version__

# Import typing - this will eventually move to polars.typing, but currently we use the internal package and fallback to the old package for older versions of Polars.
try:
from polars._typing import IntoExpr, PolarsDataType
except ImportError:
from polars.type_aliases import IntoExpr, PolarsDataType # type: ignore[no-redef]

@pl.api.register_expr_namespace("dist")
class DistancePairWise:
Expand Down
Loading