List files with their metadata in one call

Abierto
#57 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
pandas, python
Área
data

Línea de trabajo

Start by reading the client.datasets.list and watch implementations and the DatasetSource.list and watch methods; the issue does not name their file locations or tests. Check how dataset refs and metadata are returned, then see how the existing SANS example notebook uses them. Done means listings can include the requested metadata fields in each flat result while metadata(ref) remains available.

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

Descripción

client.files.list(selector) returns only file refs. Any listing that shows metadata, such as a form that lists sample runs with their titles, then reads each file's metadata with one call per file:

refs = client.files.list(Selector(role='sample'))
runs = [client.files.metadata(r)['run'] for r in refs]   # one call per file, full metadata each time

In-process this costs nothing. On the service each call is a round trip, and each returns the full metadata when the caller needs one field. Found while walking through a SANS example notebook.

Proposal. list and watch return, for each file, a flat dict of its ref and the metadata fields the caller names:

client.files.list(Selector(role='sample'), fields=('run', 'title'))
# [{'ref': FileRef(...), 'run': 60339, 'title': '...'}, ...]
  • Without fields, each entry holds the full metadata.
  • A flat dict goes straight into pd.DataFrame(...) or a GUI table, and the ref column feeds rows of a request.
  • metadata(ref) stays, for reading one file.
  • FileSource.list and watch change the same way, so a source backed by a catalogue such as SciCat can answer from its search result without further queries.

🤖 Generated with Claude Code

Lenguaje dominante
Python
Estrellas
0
Forks
1
Merge medio
9 h 23 min
PR fusionados (30 d)
65

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 scipp/essapps

Todos los issues de scipp/essapps

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.