Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

df.sort: *<C> not working #19

Open
librasteve opened this issue Feb 7, 2023 · 1 comment
Open

df.sort: *<C> not working #19

librasteve opened this issue Feb 7, 2023 · 1 comment

Comments

@librasteve
Copy link
Owner

librasteve commented Feb 7, 2023

Instaed of the given example...

say ~df.sort: { df[$++]<C> }; # sort by col C

Ideally would like to use examples such as:

say ~df.sort: *<C>;  
say ~df.sort: {.<C>}; 
say ~df.sort: {$_<C>};  

Which has been discussed over at Discord

https://discord.com/channels/538407879980482560/768511641758466088/1072494854325674075

p6steve: just to circle back on this - I have now had the time to review the implementation of role DataSlice in the Dan module and to check whether there is a simple fix to my code to get . or $_ working .... without going into the details, the status is (i) I agree that the current, working example for sort is a (bit of a) hack, (ii) DataSlice employs delegation and overloads so that it can mix Positional and Associative as "cascading accessors", this has about 80% coverage of the use cases, (iii) the issue arises because sort seems to coerce a DataSlice to an Array [which I guess is necessary to Iterate it] and this Array will not take , (iv) it is beyond my skill to identify a quick fix to dehack sort, (v) as the use cases for Dan (and it's brethren) solidifies, I would like to circle back and refactor this area (likely employing something like Hash::Agnostic / Array::Agnostic) to get the non-hacky sort syntax working, (vi) but since the hack will continue to work alongside a future "non-hackified" example I think that it's good enough for now because (vii) I am focusing my time to get Dan::Polars to MLP per the TODO lists(s) over there --- I have made an issue for this over at GH Dan and, as ever, will be happy to adapt my priorities according to comments/issues from users of Dan over on GH ...

@librasteve
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant