Improve Error-Messages

Abierto
#69 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
cli, tooling

Línea de trabajo

Comienza con eido/validation.py alrededor de _validate_object y sigue la ruta del traceback desde eido/cli.py. Reproduce el fallo con input_error.csv y pep_schema.yaml, y luego inspecciona cómo se muestran los errores de validación. Se considera terminado cuando la entrada no válida informa de un motivo de validación y un contexto útiles en lugar de un traceback poco útil.

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

Descripción

likely-solved

Hi guys,

thx for your tool! Your concept is really cool and a handy feature :)

I have decided to integrate this tool in my Snakemake-Pipeline.
However, I now already stumbled multiple times over the issue of having metadata-files that fail the eido evaluation, but the Error messages which are returned by the tool are not helping at all.
Thus, every time when I face such an error I have to invest a lot of time to finally figure out what's the reason for the failing validation.

Here is a minimal reproducible example:

  1. pep_schemal.yaml
description: Minimal example

imports:
   - http://schema.databio.org/pep/2.1.0.yaml

properties:
  samples:
    type: array
    items:
      type: object
      properties:
        sample_directory:
          type: string
          pattern: "^/\\S+$|None"
  1. input_no_error.csv
sample_name,sample_directory
test,/testung
  1. input_error.csv
sample_name,sample_directory
test,testung

Then the output:

# No error
$ eido validate input_no_error.csv -s pep_schema.yaml
Validation successful

# Error
$ eido validate input_error.csv -s pep_schema.yaml
Traceback (most recent call last):
  File "/Users/oliverkuchler/miniforge3/envs/snakemake7/bin/eido", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/oliverkuchler/miniforge3/envs/snakemake7/lib/python3.12/site-packages/eido/cli.py", line 159, in main
    validator(*arguments)
  File "/Users/oliverkuchler/miniforge3/envs/snakemake7/lib/python3.12/site-packages/eido/validation.py", line 73, in validate_project
    _validate_object(
  File "/Users/oliverkuchler/miniforge3/envs/snakemake7/lib/python3.12/site-packages/eido/validation.py", line 45, in _validate_object
    instance_name = error.instance[sample_name_colname]
                    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^

Is there any plans for the future to improve the output?
It would be very cool if one could at least see, because of which input the validation fails.

Lenguaje dominante
Python
Estrellas
5
Forks
6
Métricas de merge de PR
Sin PR fusionados en 30 d

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 pepkit/eido

Todos los issues de pepkit/eido

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.