-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
v.db.join: handle existing columns properly #3765
Conversation
For the rest, I don't really know what to look out for, and the diff (even only the first commit) is too hard to follow on a phone, I would need to look hard on a computer (but ain't available until the end of weekend). The variable renames, import alias rename, and other fixes mixed with the actual fix makes it harder to see what is equivalent or not. |
Sorry. An issue got introduced earlier, with the latest update of the module I guess. If all columns to join were present in the target table, the module started failing, which was no problem earlier. The list of "columns_to_add" was empty in that case and v.db.addcolumn then fails because columns to add are missing. |
Thanks a lot for catching this! The remaining refactoring also looks good to me. It ran successfully on some test tables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Tested and works as expected.
Small note:
Maybe you can update module doc with that short info if columns names are same in joined table, same columns names will be update in the source vector map table.
Alternatively, there could be a flag that would ensure the renaming of the same columns and joining them instead of updating existing columns.
Good points @tmszi will open a new issue for that and other further improvements of v.db.join. |
* handle existing columns properly * refactoring and removal of Python2 compatible code * add a basic testsuite
Currently,
v.db.join
fails if all columns to join already exist in the target table, becausev.db.addcolumn
is called with an empty list of columns to create.This PR addresses the issue, removes Python2 related code along with some refactoring. It also adds a test-suite.