You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After talking with @coffeemug, this is a common enough operation that it should be short.
He also proposed adding optargs group_name and reduction_name, because apparently people have asked in the past for an easy way to rename the group and reduction. (So tbl.group('a').ungroup(group_name:'foo', reduction_name:'bar') would have output of the form [{foo: ..., bar: ...}, ...].)
Positional arguments are a little weird here because when you're reading an ungroup query it isn't clear what they mean. If I saw seq.ungroup(nil, 'best_game') I would assume we were ungrouping based on the field best_game or something.
I personally like ungroup but I don't like the idea of passing an optarg to rename the groups.
We should implement #881 instead of adding the optarg.
toArray would be confusing because of cursor.toArray groupsToArray is long and kind of confusing I think since the user just sees an array if he runs table(..).group(...)
So, the reason I wanted to do the optarg is because I heard many, many times that people hate the names group and reduction and would like an easy way to rename the fields. We will eventually implement rename, but that's still annoying -- you'll have to call ungroupandrename to get what you want. Since people will frequently want to ungroup and rename, I think it makes sense to special case ungroup to support this functionality for convenience.
(Also, to limit the scope of the discussion, I think ungroup is a fine name and we should leave it as is).
@mlucy -- ok the renaming thing is up to you. I'm ok with using your syntax, or not shipping it at all now, and dealing with this later (I think I'd prefer that, actually).
Reply to this email directly or view it on GitHubhttps://github.com//issues/2033#issuecomment-36702940
.
Activity
AtnNn commentedon Feb 27, 2014
How about also adding an
as_objectoptarg that would output as{...: ..., ...}and fail if the group is not a string.mlucy commentedon Feb 27, 2014
I'm not totally opposed to that, but it seems less generally useful.
coffeemug commentedon Feb 27, 2014
Any way we can shorten this? Typing all this up is a pain. For example:
Soooo much nicer.
Could we hold off on this until we learn a bit more about what we want to do with #2032?
mlucy commentedon Feb 27, 2014
Positional arguments are a little weird here because when you're reading an
ungroupquery it isn't clear what they mean. If I sawseq.ungroup(nil, 'best_game')I would assume we were ungrouping based on the fieldbest_gameor something.coffeemug commentedon Feb 27, 2014
True. What do others think?
coffeemug commentedon Mar 5, 2014
A friendly reminder that it would be nice to work the last bit (renaming) out. Ping @neumino @mglukhovsky. What would you prefer?
neumino commentedon Mar 5, 2014
I personally like
ungroupbut I don't like the idea of passing an optarg to rename the groups.We should implement #881 instead of adding the optarg.
toArraywould be confusing because ofcursor.toArraygroupsToArrayis long and kind of confusing I think since the user just sees an array if he runstable(..).group(...)coffeemug commentedon Mar 5, 2014
So, the reason I wanted to do the optarg is because I heard many, many times that people hate the names
groupandreductionand would like an easy way to rename the fields. We will eventually implementrename, but that's still annoying -- you'll have to callungroupandrenameto get what you want. Since people will frequently want to ungroup and rename, I think it makes sense to special caseungroupto support this functionality for convenience.(Also, to limit the scope of the discussion, I think
ungroupis a fine name and we should leave it as is).neumino commentedon Mar 5, 2014
Yep, I see what you mean, but I'm still not a big fan of the optarg.
I'm not strongly opposed though, so I'm ok shipping it with @mlucy's proposal.
mglukhovsky commentedon Mar 5, 2014
I dislike
ungroup, but can't think of a better name that describes the operation, so I'm abstaining.coffeemug commentedon Mar 5, 2014
@mlucy -- ok the renaming thing is up to you. I'm ok with using your syntax, or not shipping it at all now, and dealing with this later (I think I'd prefer that, actually).
Let us know what you want to do.
mglukhovsky commentedon Mar 5, 2014
Here's an idea: you could do a write-up of the problem as a gist, post it
on Google Groups, Twitter, IRC, see what users have to say.
Or wait to resolve this after the release.
On Tue, Mar 4, 2014 at 6:07 PM, Slava Akhmechet [email protected]:
coffeemug commentedon Mar 5, 2014
This one isn't worth writing up. I do like the general idea of advertising RFCs -- we should do that more.
mlucy commentedon Mar 5, 2014
This is easy to add later. This release is already behind schedule, so I'd like to just leave it for now.
neumino commentedon Mar 5, 2014
Just to be sure,
ungroupis innextright? And what we are not shipping is just theoptarg?coffeemug commentedon Mar 5, 2014
@neumino -- correct.
This issue is done. Closing.