Repository navigation
Conversation
The script replaced only "$MAP/", so a per-map database such as $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/$MAP.db reached db.tables unexpanded and the tool failed. Replace $MAP wherever it appears, as Vect_subst_var() does, while leaving $MAPSET alone. Fixes OSGeo#8106
alteralto
marked this pull request as ready for review
October 25, 2026 22:47
Contributor
The test needs no sample data, so it belongs in pytest rather than the gunittest testsuite. It covers the sqlite/$MAP.db form from OSGeo#8106 and the vector/$MAP/sqlite.db form that already worked.
Author
|
I now checked this md doc again. Thanks for the pointer. When you looked, the description still said I was running the tests; they're done now, and I've reworked the test to follow the guide: it's pytest in scripts/v.db.addtable/tests/ (with xy_empty_dataset_session), since it needs no sample data, and the testsuite change is reverted. It covers the sqlite/$MAP.db form from the issue and the vector/$MAP/sqlite.db form that already worked. In the osgeo/grass-gis:main-alpine image the first case fails on main with the db.tables error from the issue, and both pass with this change. If you meant something else in CONTRIBUTING let me know please |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
v.db.addtablereplaced only$MAP/in the database path, so a per-map database named after the map, such as$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/$MAP.db, reacheddb.tableswith$MAPstill in it and the tool failed with "Unable to describe table".$MAPis now replaced wherever it appears, asVect_subst_var()and pygrass do.$MAPSETis left for the driver to expand: the library substitutes it before$MAP, and the script now skips it explicitly, which is what the trailing slash used to guard against.The new pytest test (
scripts/v.db.addtable/tests/, usingxy_empty_dataset_session) adds a table to a fresh vector for two connections,sqlite/$MAP.dband the existingvector/$MAP/sqlite.db, and checks the column and the database file.Tested in the
osgeo/grass-gis:main-alpineimage (8.6.0dev): on main thesqlite/$MAP.dbcase fails with thedb.tableserror from the issue and thevector/$MAP/sqlite.dbcase passes; with this change both pass. The reproducer from the issue also works, and so does the defaultsqlite/sqlite.dbconnection.Fixes #8106