Cannot update multiple rows with gramex.data.update
Is something not working as expected?
gramex.data.update does not parse args correctly.
Steps to reproduce.
Suppose there's a file.csv containing:
id, val
1, x
2, y
3, z
then the following:
gramex.data.update('file.csv', id="id", args={'id': [2, 3], 'val': ['a', 'b']})
converts it into:
id, val
1, x
2, a
3, a
Expected behavior
It should update rows 2 and 3 to a and b respectively.
Your environment:
- Gramex version: master branch as of this bug report.
I'll explore this. I forgot what the intended behavior is, but the update should be able to change multiple rows as described.
Will plan for the Nov release.
This feature has slipped by a month and will be planned for the January release
I am still behind on this feature, and it's at risk for 1.67.
@sanand0 @bhatsandeep When are we planning to fix this? This is blocking https://gramenertech.atlassian.net/browse/GRAMEX-15
Specifically, from the user management component of the admin2 app, editing attributes of multiple users at a time doesn't work.The last value overwrites the whole table.
@jaidevd -- the places to change are in data.py
- _filter_frame: under
elif source == 'update' - _filter_db: under
elif source == 'update' - _update_mongodb
Could you see if you could send a PR?