[GRASS-dev] bug in python version of v.db.renamecol / db_describe ?

Glynn,

Trying to debug the v.db.renamecol bash version, I also tried with the python version and it seems there is a bug, which IIUC should be fixed by the following patch. Can you confirm or do I misunderstand how db_describe works ?

--- SRC/GRASS/grass_trunk/scripts/v.db.renamecol/v.db.renamecol.py 2008-10-22 10:54:59.000000000 +0200
+++ SRC/GRASS/grass_trunk/dist.i486-pc-linux-gnu/scripts/v.db.renamecol 2008-11-18 16:37:03.000000000 +0100
@@ -86,7 +86,7 @@

      # describe old col
      oldcoltype = None
- for f in grass.db_describe(table):
+ for f in grass.db_describe(table)['cols']:
         if f[0] != oldcol:
             continue
         oldcoltype = f[1]

Just not familiar enough with the python lib, yet, to feel comfortable committing myself.

Moritz

Moritz Lennert wrote:

Trying to debug the v.db.renamecol bash version, I also tried with the
python version and it seems there is a bug, which IIUC should be fixed
by the following patch. Can you confirm or do I misunderstand how
db_describe works ?

- for f in grass.db_describe(table):
+ for f in grass.db_describe(table)['cols']:

That's correct. Committed as r34374, which also fixes the same bug in
v.db.dropcol.

--
Glynn Clements <glynn@gclements.plus.com>