This repository was archived by the owner on Jan 8, 2026. It is now read-only.
GRAMEX-97 ⁃ ENH: Update multiple rows in files and DBs with data.update#456
Open
jaidevd wants to merge 3 commits into
Open
GRAMEX-97 ⁃ ENH: Update multiple rows in files and DBs with data.update#456jaidevd wants to merge 3 commits into
jaidevd wants to merge 3 commits into
Conversation
sanand0
reviewed
Sep 28, 2021
|
|
||
| names = ['Humphrey Bogart', 'James Stewart', 'Audrey Hepburn'] | ||
| categories = ['Stars', 'Thespians', 'Heartthrobs'] | ||
| ratings = [1, 0.99, 1.11] |
Contributor
There was a problem hiding this comment.
Please add a test case where
ratingshas only 2 values [1, 0.99] and the third is missing. Audrey's rating should not get updated, but her categories should be.nameshas only 2 values -- in which case, the 3rd category and rating are ignored
Contributor
Author
There was a problem hiding this comment.
@sanand0 This works for files, but for sqlalchemy, to deal with uneven args, we might have to do column-wise update queries. Is this acceptable?
Contributor
There was a problem hiding this comment.
@jaidevd -- yes, column-wise update queries are fine. I don't anticipate this to be used often and we can optimize later
| df = gramex.data.filter(temp_db, args={'name': names}, table='actors') | ||
| self.assertEqual(df['category'].tolist(), categories) | ||
| self.assertEqual(df['rating'].tolist(), ratings) | ||
|
|
Contributor
There was a problem hiding this comment.
Please add test cases for MySQL, PostgreSQL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #312
┆Issue is synchronized with this Jira Bug