Skip to content

0nly update row counters on output records#1323

Merged
kylebaron merged 3 commits intomainfrom
fix/rown-update
Feb 12, 2026
Merged

0nly update row counters on output records#1323
kylebaron merged 3 commits intomainfrom
fix/rown-update

Conversation

@kylebaron
Copy link
Collaborator

@kylebaron kylebaron commented Feb 11, 2026

There could be non-output records that are encountered between two output records. When the row counters are incremented, these updated counters can suggest we are farther along in the output data than we really are. There is no change to when counters are incremented, but I'm going to wait to update the objects that the user sees until we are actually advancing to an output record. I could potentially see refactoring when those counters are incremented, but I think it would be easier at this point to just keep the existing logic and go with an easy adjustment that only controls when the user sees this.

While investigating this issue, a separate issue was found with the individual counter when only an individual data set is passed #1324 .

Also opened #1322 where we will only insert tgrid records through the last output data set time.

code_counter_update_on_output <- '
$preamble capture total = 0;
$main self.mtime(12);
$table if(self.rown+1 == self.nrow) ++total;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The condition tested here should only evaluate true once during the problem. With the mtime call and the delta we picked in the output time grid, it will get called twice because the counter got incremented indicating we were at the final record, but really we were seeing a non-output record.

@kylebaron kylebaron requested a review from kyleam February 11, 2026 14:02
Copy link
Contributor

@kyleam kyleam left a comment

Choose a reason for hiding this comment

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

but I think it would be easier at this point to just keep the existing logic and go with an easy adjustment that only controls when the user sees this.

Makes sense to me.

@kylebaron kylebaron merged commit 73527e7 into main Feb 12, 2026
7 checks passed
@kylebaron kylebaron deleted the fix/rown-update branch February 12, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants