Open jcrist opened 1 week ago
In all seriousness, I really like this idea!
Sounds good! I think we should aim to get this in for 10.0 then.
One open question is what to do with scalars (since in interactive mode they only show the value, not the type).
A few options:
# Interactive
┌────────────┐
│ float64 │
├────────────┤
│ 43040.87 │
└────────────┘
# Non-interactive (could also only add the type to the non-interactive version?)
┌─────────┐
│ float64 │
├─────────┤
│ … │
└─────────┘
# Interactive
┌──────────┐
│ 43040.87 │
└──────────┘
# Non-interactive
Scalar<float64>
# Interactive
┌──────────┐
│ 43040.87 │
└──────────┘
# Non-interactive (this might be easy to mistake for an interactive string scalar with value `"Scalar<float64>"`)
┌─────────────────┐
│ Scalar<float64> │
└─────────────────┘
I have a slight preference for the first option, but :shrug:.
I definitely like the look of this -- it might be nice to keep the old repr around for OUR inspection, but make it private.
I like option 1 above, but I can get on board with any of them.
I randomly found this and just wanted to chime in: I think this sounds like a great idea and moving the old repr to an explain
function or something similar makes a lot of sense.
it might be nice to keep the old repr around for OUR inspection, but make it private.
not sure what visibility you mean by private (maybe just surrounded wth __
?) but it'd be nice for it to be easily accessible for substrait users. I could also imagine wanting to extend it with various verbosity flags (ops only, ops + predicates, etc.) to make validation or general observability easier.
not sure what visibility you mean by private
yeah, just with a leading _
so it doesn't show up in tab-completion, but I'm also not opposed to leaving it more readily available if there's desire for that.
Currently when constructing ibis expressions in non-interactive mode (the default), expressions repr as a description of the operations they're composed of:
While this expr repr can be nice for inspection, it's rarely what I want when building up expressions lazily. Since ibis expressions are very composable, rarely do I need to know the steps used to get to a certain expression (e.g. I don't care that a
group_by
orfilter
was called earlier). Really all I care about is the schema/type of the object.I propose we:
expr.explain()
or something.A quick mockup: