Skip to content

ref: simplify cache dir creation and remove repeated parts #568

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 2 commits into from
Apr 26, 2025

Conversation

bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented Apr 26, 2025

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?

ref: simplify cache dir creation and remove repeated parts

prep for resolving cace dir issues for hf dataset

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the cache directory creation process and removes redundant code for handling cache directories in datasets.

  • Consolidated the cache directory creation logic in _try_create_cache_dir.
  • Updated documentation and comments to improve clarity, especially around handling the updated_at hash and environment-dependent cache roots.
Comments suppressed due to low confidence (1)

src/litdata/utilities/dataset_utilities.py:211

  • [nitpick] The variable name 'input_dir_hash_path' is inconsistent with the parameter name 'input_dir_hash_filepath' used elsewhere. Consider renaming it to 'input_dir_hash_filepath' for clarity and consistency.
input_dir_hash_path = os.path.join(cache_root, dir_url_hash)

Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79%. Comparing base (b1645b6) to head (39531e2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #568   +/-   ##
===================================
  Coverage    79%    79%           
===================================
  Files        40     40           
  Lines      6101   6098    -3     
===================================
+ Hits       4821   4822    +1     
+ Misses     1280   1276    -4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Nice !

@bhimrazy bhimrazy merged commit 9fb8019 into Lightning-AI:main Apr 26, 2025
28 of 29 checks passed
@bhimrazy bhimrazy deleted the ref/cache-dir-creation branch April 26, 2025 08:47
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.

2 participants