-
Notifications
You must be signed in to change notification settings - Fork 67
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
Assignment to array element #4798
Comments
Here's an example from within the Zed language itself where I imagine users could likely bump into this. Let's say a user has this test data.
Now imagine they want to change the field names to all lowercase, such as was one of the first steps in this Python/Pandas shaping exercise. Right now in Zed, iterating through record fields by name is done via the
Notice that
|
I happened to revisit this issue just to see if the changes in #4795 affected what's described here, and it turns out this did indeed happen. Starting with Zed commit ef9695f which is associated with the changes in #4795, the simple repro shown in the opening of this issue no longer results in the
I guess it's doing something like converting the |
Update the put operator to allow assignments to elements in an array or set. Closes #4798
Update the put operator to allow assignments to elements in an array or set. Closes #4798
Update the put operator to allow assignments to elements in an array or set. Closes #4798
Update the put operator to allow assignments to elements in an array or set. Closes #4798
Update the put operator to allow assignments to elements in an array or set. Closes #4798
Repro is with Zed commit 63d6b29. This variation was actually first called out in #4651 (comment).
Here's an example of something that's easy in Python, which might be familiar to our data-centric users due to how Python is often used with Pandas et al.
Attempting the same using Zed with what I'd think of as the equivalent straightforward syntax:
It's been pointed out that it's possible to get there today if the user is familiar with slices & spread:
However, given how the simple reference to the element on the left-hand side is common in other languages, it seems like it would be convenient to the user if it worked similarly in Zed.
FWIW, I tried to make use of this syntax in https://github.com/brimdata/challenges/blob/aace23e1ef85b7f411323d776977afc4cfa9935e/ames-shaping/shaper.zed#L3-L23.
The text was updated successfully, but these errors were encountered: