-
Notifications
You must be signed in to change notification settings - Fork 8
[Fix] s3 prefix issue while downloading from ObjectStore #824
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
base: main
Are you sure you want to change the base?
Conversation
📜 Docstring Coverage ReportRESULT: PASSED (minimum: 30.0%, actual: 75.5%) Detailed Coverage Report |
📦 Trivy Vulnerability Scan Results
Report Summary
Scan Result Details✅ No vulnerabilities found during the scan for |
📦 Trivy Secret Scan Results
Report Summary
Scan Result Details✅ No secrets found during the scan for |
|
🛠 Docs available at: https://k.atlan.dev/application-sdk/fix-s3-path-issue |
| # os.path.commonpath or os.path.relpath can raise ValueError on Windows with different drives | ||
| # In this case, treat as user-provided path, return as-is | ||
| return path.strip("/") | ||
| return path.lstrip("/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Trailing slashes no longer removed from S3 paths
Changing from strip("/") to lstrip("/") removes only leading slashes instead of both leading and trailing slashes. This breaks the documented behavior shown in the example where "datasets/sales/2024/" should return "datasets/sales/2024". Paths with trailing slashes will now be preserved, potentially causing S3 prefix mismatches where paths like "prefix/" are treated differently than "prefix".
Changelog
Additional context (e.g. screenshots, logs, links)
Checklist
Copyleft License Compliance
Note
Replace strip with lstrip in get_object_store_prefix to avoid trimming trailing slashes, fixing S3 prefix handling.
get_object_store_prefixinapplication_sdk/activities/common/utils.py:path.lstrip("/")instead ofpath.strip("/")for non-temp and exception paths to preserve trailing slashes in object store prefixes.Written by Cursor Bugbot for commit 5890142. This will update automatically on new commits. Configure here.