ObjectRef.full_path: the file branch and plugin storage protocols still build the path by hand

Đang mở
#1,679 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data-engineering

Hướng nghiên cứu

Start with src/datajoint/objectref.py and inspect ObjectRef.full_path alongside StorageBackend._full_path; the issue identifies the file branch, plugin storage branch, and location normalization as the affected paths. Read the tests for object references and storage adapters, then add coverage for the reported behaviors, including a literal path that pins current location handling. Done means the return behavior for file references is decided and the plugin branch includes its store location without changing existing object keys.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Follow-up to #1646 and #1648. #1648 makes ObjectRef.full_path use the backend's get_url() for s3, gcs and azure stores, so the location is included. Two other branches of full_path (src/datajoint/objectref.py) still build the path themselves:

  • file protocol: returns str(Path(location) / self.path). On Windows this gives backslashes, the path is not made absolute, and the docstring promises a URI while this branch returns a plain path. Switching it to get_url() would return file:///... and break callers that do open(ref.full_path), so the return type needs an explicit decision, or the branch should use _full_path.
  • Any other protocol (storage adapters registered through the datajoint.storage entry point): returns the bare self.path, without the store location, which is the same bug as #1646. StorageAdapter already provides get_url and full_path, so return self._backend.get_url(self.path) would fix it.

Separately, StorageBackend._full_path does not normalize the location: "proj/outbox/" gives s3://bkt/proj/outbox//.... That is consistent with where objects are written today, so changing it would move the keys of existing stores. A test that pins the current behavior with a literal path would make any later change deliberate.

Ngôn ngữ chính
Python
Star
198
Fork
103
Merge trung bình
6 ngày 1 giờ
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của datajoint/datajoint-python

Tất cả issue của datajoint/datajoint-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.