Skip to content
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

Path Relativization: Metafile and Locator Write Paths #502

Merged
merged 15 commits into from
Mar 14, 2025

Conversation

martinezdavid12
Copy link
Contributor

Summary

Implemented path relativization for paths embedded within the metafile and locator metadata of individual transaction operations. This occurs prior to serializing the transaction object to ensure relative paths are used throughout.

Rationale

The introduction of path relativization improves system portability by enabling dynamic resolution of paths relative to the catalog root. This simplifies user-specific configurations and enhances flexibility in permission management across different environments.

Changes

  • Modified deltacat/storage/model/transaction.py by implementing the relativization method. This includes the addition of operation-level logic and comprehensive error handling. The to_serializable() method has been refactored to accept the catalog root path, providing the necessary context for the relativization process.

  • Added a new test file deltacat/tests/storage/model/test_abs_to_relative.py, to verify the correctness of the relativization logic. The tests include both unit tests for the helper functions and integration tests that simulate real-world transactions and operations.

Impact

All tests have passed successfully, indicating that the changes do not break existing functionality. Further testing is recommended to ensure compatibility with all potential use cases and that no unintended regressions have been introduced.

Testing

  • The test suite deltacat/tests/storage/model/test_abs_to_relative.py was added to validate the new relativization logic. The tests cover both the functionality of individual helper methods and full integration via mock transactions and operations.

@martinezdavid12 martinezdavid12 marked this pull request as draft March 10, 2025 18:15
@martinezdavid12 martinezdavid12 marked this pull request as ready for review March 10, 2025 18:16
@pdames pdames self-requested a review March 10, 2025 18:47
Copy link
Member

@pdames pdames left a comment

Choose a reason for hiding this comment

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

This looks like a pretty good start on the problem - thanks! I think this should be good to merge after addressing the open comments (which I expect to also trickle into updates to the included test suite).

Copy link
Member

@pdames pdames left a comment

Choose a reason for hiding this comment

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

LGTM - thanks! Please address your newly added TODO in a fast-follow PR. If some of our existing code paths are already incorrectly using relative locator and/or metafile paths before calling your path relativization method, then they'll probably need to be updated to only use absolute paths.

@pdames pdames merged commit 45916eb into ray-project:2.0 Mar 14, 2025
3 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.

2 participants