Skip to content

Fix logic error in behavior list clipping#100

Open
prjanitor wants to merge 1 commit into
deepray-AI:mainfrom
prjanitor:prjanitor/1ad680c30acec1230c8cb7daf5f28d27b7360505
Open

Fix logic error in behavior list clipping#100
prjanitor wants to merge 1 commit into
deepray-AI:mainfrom
prjanitor:prjanitor/1ad680c30acec1230c8cb7daf5f28d27b7360505

Conversation

@prjanitor
Copy link
Copy Markdown

The previous implementation of _clip_clicks used simple increments/decrements on begin_idx and end_idx based on timestamp conditions. This was problematic because:

  1. If multiple timestamps satisfied the condition, indices could cross or become invalid.
  2. It didn't correctly identify the boundaries of the valid history window within the list.

The fix updates begin_idx to be the index after the last timestamp that is too old, and end_idx to be the index of the first timestamp that is too new (or equal to max_ts), ensuring a correct slice for the behavior lists.


This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

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.

1 participant