Skip to content

Commit

Permalink
feat(repr): add interval info to interval repr
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gforsyth authored and cpcloud committed Apr 5, 2022
1 parent 9f403e2 commit df26231
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ibis/expr/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ def _fmt_value_negate(op: ops.Negate, *, aliases: Aliases) -> str:

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


Expand Down

0 comments on commit df26231

Please sign in to comment.