grass
grass copied to clipboard
Add a standard parser option for JSON formatting
As a part of https://github.com/OSGeo/grass/discussions/3019, JSON format support will be added to multiple modules. By default, modules output in existing plain format. If the format=json option is provided, modules will output in JSON format instead. To avoid duplication of code across several modules, define a standard parser option.
This is great improvement @kritibirda26. To fix the OSGeo4W CI, please update your branch from main (e.g. Update branch on GitHub or merge main locally into this branch).
@petrasovaa Hi! I have updated v.db.select and also changed the option to be required by default.
The tests are failing with this weird error but the build passes locally. Also, the string that is said to be invalid is actually a valid isoformat string. Any suggestions on how to debug?
gnu/docs/html/g.gui.timeline.html
Traceback (most recent call last):
File "/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/utils/mkhtml.py", line 921, in <module>
git_commit = get_last_git_commit(
File "/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/utils/mkhtml.py", line 397, in get_last_git_commit
return parse_git_commit(
File "/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/utils/mkhtml.py", line 242, in parse_git_commit
git_log["date"] = format_git_commit_date_from_local_git(
File "/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/utils/mkhtml.py", line 345, in format_git_commit_date_from_local_git
return datetime.fromisoformat(
ValueError: Invalid isoformat string: '2024-05-17T16:09:45Z'
https://github.com/OSGeo/grass/actions/runs/9131120968/job/25109628154?pr=3704#step:8:6469
A guess: it probably expects a string without the 'Z' character?
@neteler I see, do you know if there is a local git setting I can configure to fix the datetime format for the commit timestamp?
This is failing across several PRs with repeated runs. I'm opening a separate issue to discuss this.
What prefix for the title of the PR should be used before merging, once it is rebased? (the build issue is most probably fixed now on main).
Thanks all for reviewing the PR and helping fix the CI issues. Please let me know me if any other changes are needed in this PR.
@petrasovaa previously requested changes, she might want to place an approval to overrule her review.
And a prefix for the PR, so it can be classified in the release notes. I'm not sure which one to apply.
Sorry for beeing late here.
I just noticed that this new standard parser option:
- is not groupt with the other
Foptions but comes last in the list (so out of order). See: https://grass.osgeo.org/grass84/manuals/parser_standard_options.html - does not have a decription (seems to be a typo with descriptions)
- should probably explicitly default to NO for "multiple"
Should the format option also cover other formats (CSV, shell, ...), those are currently missing, but a long list of possible formats will probably defeat the purpose of the standard paser option?
Just comments you may consider... Anyway, I am glad to see this standard parser option...