Skip to content

Commit

Permalink
refactor(polars): delete some dead versioning code
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrist committed Jul 23, 2024
1 parent f83d84f commit b23c5a3
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions ibis/backends/polars/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import numpy as np
import pandas as pd
import polars as pl
from packaging.version import parse as vparse

import ibis.common.exceptions as com
import ibis.expr.datatypes as dt
Expand Down Expand Up @@ -665,17 +664,7 @@ def clip(op, **kw):
lower = _literal_value(op.lower)
upper = _literal_value(op.upper)

if vparse(pl.__version__) >= vparse("0.19.12"):
if not (lower is None and upper is None):
return arg.clip(lower, upper)
elif lower is not None and upper is not None:
return arg.clip(lower, upper)
elif lower is not None:
return arg.clip_min(lower)
elif upper is not None:
return arg.clip_max(upper)

raise com.TranslationError("No lower or upper bound specified")
return arg.clip(lower, upper)


@translate.register(ops.Log)
Expand Down

0 comments on commit b23c5a3

Please sign in to comment.