Skip to content

Commit df26231

Browse files
gforsythcpcloud
authored andcommitted
feat(repr): add interval info to interval repr
trying this out. there are a lot of ways to make this more complicated and some of them might be worth it, but this seems to provide a little more information with a tiny footprint.
1 parent 9f403e2 commit df26231

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ibis/expr/format.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ def _fmt_value_negate(op: ops.Negate, *, aliases: Aliases) -> str:
534534

535535
@fmt_value.register
536536
def _fmt_value_literal(op: ops.Literal, **_: Any) -> str:
537+
if isinstance(op.dtype, dt.Interval):
538+
return f"{op.value} {op.dtype.unit}"
537539
return repr(op.value)
538540

539541

0 commit comments

Comments
 (0)