Skip to content

GDR-3366: fix handling of NA Duration#193

Merged
bczech merged 4 commits into
mainfrom
GDR-3366
May 5, 2026
Merged

GDR-3366: fix handling of NA Duration#193
bczech merged 4 commits into
mainfrom
GDR-3366

Conversation

@bczech
Copy link
Copy Markdown
Contributor

@bczech bczech commented Apr 28, 2026

Description

What changed?

Related JIRA issue: GDR-3366

Replace == 0 with %in% 0 for Duration comparisons in Day0 detection, and add is.na(duration) guard in GR value back-calculation.

Why was it changed?

Follow-up to gDRimport#119 — Duration can now be NA_real_ and must be handled gracefully throughout the pipeline.

Checklist for sustainable code base

  • I added tests for any code changed/added
  • I added documentation for any code changed/added
  • I made sure naming of any new functions is self-explanatory and consistent

Logistic checklist

  • Package version bumped
  • Changelog updated

@bczech bczech requested a review from a team as a code owner April 28, 2026 12:33
@bczech bczech requested review from darsoo and j-smola and removed request for a team April 28, 2026 12:33
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the package version to 1.9.9 and addresses issues with NA duration values in Day0 detection and GR value calculations. Key changes include replacing direct equality checks with %in% 0 to safely handle NA values and adding explicit checks for missing duration in calculate_GR_value. New test cases have been implemented to ensure NA durations are handled correctly. I have no feedback to provide.

bczech and others added 2 commits May 4, 2026 11:46
When no t0 rows exist (Duration == NA everywhere), the global all-NA
column removal was incorrectly stripping columns from Day0. Save and
restore Day0 across the gDRutils::loop call when has_day0 is FALSE,
so Day0 is only modified by the t0-specific check (second if).
@bczech bczech merged commit 0a1f4ab into main May 5, 2026
3 of 4 checks passed
@bczech bczech deleted the GDR-3366 branch May 5, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants