Skip to content

g.parser: Missing support G_OPT_F_FORMAT in python %option#7071

Merged
petrasovaa merged 8 commits intoOSGeo:mainfrom
gulshan-123:std_opt
Feb 13, 2026
Merged

g.parser: Missing support G_OPT_F_FORMAT in python %option#7071
petrasovaa merged 8 commits intoOSGeo:mainfrom
gulshan-123:std_opt

Conversation

@gulshan-123
Copy link
Contributor

@gulshan-123 gulshan-123 commented Feb 10, 2026

Currently using below gives the unexpected warning:

# %option G_OPT_F_FORMAT
# % guisection: Formatting
# %end
WARNING: Bug in UI description. Missing option key
WARNING: Bug in UI description. Description for option <?> missing
WARNING: Bug in UI description. Missing option key
WARNING: Bug in UI description. Description for option <?> missing 

This was detected as a part of #7051 (comment).

The reason was G_OPT_F_FORMAT is missing in standard_option.c.

NOTE: The C code is not affected because, those directly use G_define_standard_option(), but for parsing python %option, we use define_standard_option which compares the string defined in the STD_OPT_STRINGS (with same index as enum declared in gis.h).

@gulshan-123
Copy link
Contributor Author

I'm not sure which type of tests should I add so that missing to add may be avoided in future?
Or should we plan to merge the two things: arrays and enums (is this possible?)?
Ideas please...

ninsbl
ninsbl previously requested changes Feb 11, 2026
Copy link
Member

@ninsbl ninsbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks in principle good to me. Just one minur comment...
The failing tests are likely unrelated...

@wenzeslaus
Copy link
Member

There is likely a Python tool which should probably have it since the time this was introduced. Is there?

@ninsbl
Copy link
Member

ninsbl commented Feb 11, 2026

There is likely a Python tool which should probably have it since the time this was introduced. Is there?

Does not seem so. See: https://github.com/search?q=repo%3AOSGeo%2Fgrass%20path%3A*.py%20language%3APython%20G_OPT_F_FORMAT&type=code
vs.
https://github.com/search?q=repo%3AOSGeo%2Fgrass%20path%3A*.c%20language%3AC%20G_OPT_F_FORMAT&type=code

@ninsbl
Copy link
Member

ninsbl commented Feb 11, 2026

db.univar, v.db.univar, and t.rast.list could have used it: https://github.com/search?q=repo%3AOSGeo%2Fgrass%20path%3A*.py%20language%3APython%20%22key:%20format%22&type=code

@wenzeslaus
Copy link
Member

...should have it already, but it does not is what I meant to say.

Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have it in these tools and this PR is the place to do it.

@gulshan-123
Copy link
Contributor Author

Thank you!
I have now added #option G_OPT_F_FORMAT in db.univar, v.db.univar and t.rast.list.
Also Added the format option description in t.rast.list just for completeness

@github-actions github-actions bot added vector Related to vector data processing temporal Related to temporal data processing Python Related code is in Python database Related to database management labels Feb 12, 2026
@petrasovaa petrasovaa added the backport to 8.5 PR needs to be backported to release branch 8.5 label Feb 12, 2026
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to go! Thanks!

@petrasovaa petrasovaa dismissed stale reviews from wenzeslaus and ninsbl February 13, 2026 18:45

Adressed.

@petrasovaa petrasovaa merged commit c9d0784 into OSGeo:main Feb 13, 2026
26 checks passed
@github-actions github-actions bot added this to the 8.6.0 milestone Feb 13, 2026
@petrasovaa petrasovaa removed the backport to 8.5 PR needs to be backported to release branch 8.5 label Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C database Related to database management general libraries module Python Related code is in Python temporal Related to temporal data processing vector Related to vector data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants