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

Cannot update multiple rows with gramex.data.update #312

Open
jaidevd opened this issue Oct 15, 2020 · 5 comments · May be fixed by #456
Open

Cannot update multiple rows with gramex.data.update #312

jaidevd opened this issue Oct 15, 2020 · 5 comments · May be fixed by #456
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jaidevd
Copy link
Member

jaidevd commented Oct 15, 2020

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.
@jaidevd jaidevd added the bug Something isn't working label Oct 15, 2020
@sanand0
Copy link
Contributor

sanand0 commented Oct 15, 2020

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.

@sanand0 sanand0 added this to the 1.65 milestone Oct 15, 2020
@sanand0 sanand0 modified the milestones: 1.65, 1.66 Nov 1, 2020
@sanand0
Copy link
Contributor

sanand0 commented Nov 1, 2020

This feature has slipped by a month and will be planned for the January release

@sanand0 sanand0 modified the milestones: 1.66, 1.67 Dec 2, 2020
@sanand0
Copy link
Contributor

sanand0 commented Dec 30, 2020

I am still behind on this feature, and it's at risk for 1.67.

@sanand0 sanand0 modified the milestones: 1.67, 1.68 Jan 7, 2021
@sanand0 sanand0 modified the milestones: 1.68, 1.69 Feb 2, 2021
@jaidevd
Copy link
Member Author

jaidevd commented Sep 28, 2021

@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.

@sanand0
Copy link
Contributor

sanand0 commented Sep 28, 2021

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants