Skip to content

bugfix: pulling n * chunk_size + 1 #4662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 18, 2024

Conversation

frascuchon
Copy link
Member

Description

This PR fixes errors computing chunk limits when pulling records from some argilla dataset

Type of change

(Please delete options that are not relevant. Remember to title the PR according to the type of change)

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested

(Please describe the tests that you ran to verify your changes. And ideally, reference tests)

  • Test A
  • Test B

Checklist

  • I followed the style guidelines of this project
  • I did a self-review of my code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I filled out the contributor form (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 15, 2024
@dosubot dosubot bot added area: tests Indicates that an issue or pull request is related to the tests language: python Pull requests or issues that update Python code severity: minor Indicates that the issue isn't urgent or blocking team: backend Indicates that the issue or pull request is owned by the backend team type: bug Indicates an unexpected problem or unintended behavior labels Mar 15, 2024
@@ -68,8 +68,7 @@ def __getitem__(
offsets = list(range(start, stop, FETCHING_BATCH_SIZE))
limits = [FETCHING_BATCH_SIZE] * len(offsets)
if stop % FETCHING_BATCH_SIZE != 0:
offsets[-1] = stop - (stop % FETCHING_BATCH_SIZE) + 1
limits[-1] = (stop % FETCHING_BATCH_SIZE) - 1
limits[-1] = (stop % FETCHING_BATCH_SIZE)
Copy link
Member Author

Choose a reason for hiding this comment

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

@alvarobartt I think I'm not missing any other case. We should just adapt the last chunk limit starting at 1 instead of 0. So % result is enough.

Copy link

The URL of the deployed environment for this PR is https://argilla-quickstart-pr-4662-ki24f765kq-no.a.run.app

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.07%. Comparing base (6630d7b) to head (9121132).
Report is 688 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4662      +/-   ##
===========================================
- Coverage    90.13%   89.07%   -1.06%     
===========================================
  Files          233      190      -43     
  Lines        12493    11666     -827     
===========================================
- Hits         11261    10392     -869     
- Misses        1232     1274      +42     
Flag Coverage Δ
pytest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 18, 2024
@frascuchon frascuchon merged commit 59370a6 into develop Mar 18, 2024
16 checks passed
@frascuchon frascuchon deleted the bugfixes/pulling_n_x_chunk_size_records_plus_one branch March 18, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tests Indicates that an issue or pull request is related to the tests language: python Pull requests or issues that update Python code lgtm This PR has been approved by a maintainer severity: minor Indicates that the issue isn't urgent or blocking size:S This PR changes 10-29 lines, ignoring generated files. team: backend Indicates that the issue or pull request is owned by the backend team type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants