Skip to content
Closed
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
11 changes: 11 additions & 0 deletions insights/insights/doctype/insights_data_source_v3/ibis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,17 @@ def get_current_columns(self):
return {col: getattr(self.query, col) for col in self.query.schema().names}


<<<<<<< HEAD
=======
def clamp(value, lo: int, hi: int) -> int:
"""Cast *value* to int and clamp it to [lo, hi], returning *default* on failure."""
try:
return max(lo, min(int(value), hi))
except (TypeError, ValueError):
return lo


>>>>>>> 8724803c (fix: clamp function arguments (#1015))
def execute_ibis_query(
query: IbisQuery,
limit=100,
Expand Down