Skip to content

Commit

Permalink
🐛 fix import paths for polars >= 0.20.14 (#20)
Browse files Browse the repository at this point in the history
* 🐛 fix import paths for polars >= 0.20.14

* remove unrelated change

* fix mypy
  • Loading branch information
danielgafni authored Mar 11, 2024
1 parent c23091f commit 6476953
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions polars_hash/polars_hash/polars_hash/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
from __future__ import annotations

import warnings
from packaging.version import Version
from typing import Iterable, Protocol, cast

import polars as pl
from polars.type_aliases import IntoExpr, PolarsDataType
from polars.utils._parse_expr_input import parse_as_expression
from polars.utils._wrap import wrap_expr

from polars.utils.udfs import _get_shared_lib_location

if Version(pl.__version__) >= Version("0.20.14"):
from polars._utils.parse_expr_input import parse_as_expression
from polars._utils.wrap import wrap_expr
else:
# old locations prior to https://github.com/pola-rs/polars/commit/b8d7a0f5492b662787d790c35712f0daabd01429
from polars.utils._parse_expr_input import parse_as_expression # type: ignore
from polars.utils._wrap import wrap_expr # type: ignore


from ._internal import __version__ as __version__

lib = _get_shared_lib_location(__file__)
Expand Down

0 comments on commit 6476953

Please sign in to comment.