Skip to content

Fix StreamingDataset len after drop_last update#778

Merged
tchaton merged 3 commits into
Lightning-AI:mainfrom
MagellaX:bugfix/772-len-drop-last
Jan 7, 2026
Merged

Fix StreamingDataset len after drop_last update#778
tchaton merged 3 commits into
Lightning-AI:mainfrom
MagellaX:bugfix/772-len-drop-last

Conversation

@MagellaX

@MagellaX MagellaX commented Jan 3, 2026

Copy link
Copy Markdown
Contributor
Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Fixes #772.

@gitguardian

gitguardian Bot commented Jan 3, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
5685611 Triggered Generic High Entropy Secret 702ae1c tests/streaming/test_resolver.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@codecov

codecov Bot commented Jan 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80%. Comparing base (5913181) to head (6b283bf).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #778   +/-   ##
===================================
- Coverage    80%    80%   -0%     
===================================
  Files        52     52           
  Lines      7362   7366    +4     
===================================
+ Hits       5906   5907    +1     
- Misses     1456   1459    +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…tion

- Add enhanced docstrings to set_shuffle() and set_drop_last() explaining cache invalidation rationale
- Clarify that shuffler is invalidated to ensure length calculations reflect parameter changes
- Update inline comments to explain why shuffler reset is necessary
- Simplify test docstring per repo conventions
- Add explicit assertion for expected batch count in test_len_called_before_dataloader_drop_last
- Ensures developer clarity on cache invalidation behavior

@bhimrazy bhimrazy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Nice catch, @MagellaX! Thanks 🙌

@MagellaX

MagellaX commented Jan 5, 2026

Copy link
Copy Markdown
Contributor Author

it's all good to merge!!

@MagellaX

MagellaX commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

pls merge it, so i can later delete this branch!!

@tchaton tchaton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice catch !

@tchaton tchaton merged commit c2252a6 into Lightning-AI:main Jan 7, 2026
37 checks passed
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.

PyTorch Lightning doesn't perform validation with StreamingDataset in a special case

3 participants