Skip to content

temporal: fix string formatting in fatal error messages#7228

Open
selma-Bentaiba wants to merge 1 commit intoOSGeo:mainfrom
selma-Bentaiba:fix-string-formatting-shift-snap-rename
Open

temporal: fix string formatting in fatal error messages#7228
selma-Bentaiba wants to merge 1 commit intoOSGeo:mainfrom
selma-Bentaiba:fix-string-formatting-shift-snap-rename

Conversation

@selma-Bentaiba
Copy link
Copy Markdown

@selma-Bentaiba selma-Bentaiba commented Mar 28, 2026

  • Fix dict formatting in shift() (tuple of dicts → single dict)
    dicts was passed instead of single dict, causing TypeError.
  • Fix same formatting bug in snap() and rename()
  • Remove trailing whitespace

- Fix dict formatting in shift() (tuple of dicts → single dict)
- Add missing return True in shift()
- Fix same formatting bug in snap() and rename()
- Remove trailing whitespace
@github-actions github-actions bot added Python Related code is in Python libraries labels Mar 28, 2026
selma-Bentaiba added a commit to selma-Bentaiba/grass that referenced this pull request Mar 28, 2026
shift() returns None on success but signature declares -> bool.
Add explicit return True to match contract.

Follow-up to OSGeo#7228
selma-Bentaiba added a commit to selma-Bentaiba/grass that referenced this pull request Mar 28, 2026
shift() returns None on success but signature declares -> bool.
Add explicit return True to match contract.

Follow-up to OSGeo#7228
selma-Bentaiba pushed a commit to selma-Bentaiba/grass that referenced this pull request Mar 28, 2026
Introduces unittests_temporal_stds_management.py with dedicated
coverage for core management methods that had no existing tests.

- test_shift_absolute_time: timestamps advance by the given granularity
- test_shift_invalid_granularity: regression test for OSGeo#7228, ensures
  invalid input returns False rather than a formatting TypeError
- test_snap_closes_gaps: end times are snapped to next map's start time

test_shift_relative_time is commented out because relative time unit
type resolution fails in GRASS 7.8.7 with 'unsupported unit type: None'.
Needs verification against GRASS 8.x once OSGeo#7231 is merged.

Related: OSGeo#7228 (fix string formatting in fatal error messages)
         OSGeo#7231 (add explicit return True in shift())
selma-Bentaiba pushed a commit to selma-Bentaiba/grass that referenced this pull request Mar 28, 2026
Introduces unittests_temporal_stds_management.py with dedicated
coverage for core management methods that had no existing tests.

- test_shift_absolute_time: timestamps advance by the given granularity
- test_shift_invalid_granularity: regression test for OSGeo#7228, ensures
  invalid input returns False rather than a formatting TypeError
- test_snap_closes_gaps: end times are snapped to next map's start time

test_shift_relative_time is commented out because relative time unit
type resolution fails in GRASS 7.8.7 with 'unsupported unit type: None'.
Needs verification against GRASS 8.x once OSGeo#7231 is merged.

Related: OSGeo#7228 (fix string formatting in fatal error messages)
         OSGeo#7231 (add explicit return True in shift())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants