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

Abierto
#1,679 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 6 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
198
Forks
103
Merge medio
6 d 1 h
PR fusionados (30 d)
10

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de datajoint/datajoint-python

Todos los issues de datajoint/datajoint-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.