Skip to content

temporal: add explicit return True in shift()#7231

Open
selma-Bentaiba wants to merge 1 commit intoOSGeo:mainfrom
selma-Bentaiba:fix-shift-return-type
Open

temporal: add explicit return True in shift()#7231
selma-Bentaiba wants to merge 1 commit intoOSGeo:mainfrom
selma-Bentaiba:fix-shift-return-type

Conversation

@selma-Bentaiba
Copy link
Copy Markdown

Follow-up to #7228

shift() method returns None on success but signature declares -> bool.
Add explicit return True to match the documented contract.

Currently works because caller uses is False strict check,
but correct behavior should return bool as documented.

shift() returns None on success but signature declares -> bool.
Add explicit return True to match contract.

Follow-up to OSGeo#7228
@selma-Bentaiba selma-Bentaiba force-pushed the fix-shift-return-type branch from 9ace12c to 4372527 Compare March 28, 2026 10:23
@github-actions github-actions bot added Python Related code is in Python libraries labels Mar 28, 2026
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