RedisVL warnings are never shown when the application has not configured logging
Los mantenedores suelen responder en 4 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 77/100
Línea de trabajo
Empieza con redisvl/utils/log.py e inspecciona cómo get_logger añade manejadores. Reproduce el comportamiento con el script proporcionado, tanto antes como después de logging.basicConfig(), y luego revisa las pruebas relacionadas con la advertencia por un campo vectorial sin analizar. La tarea está terminada cuando las advertencias de RedisVL llegan a stderr a través de lastResort sin configuración de logging, mientras que el logging configurado sigue funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
RedisVL's warnings never reach an application that has not configured logging, including the ones that signal lost data.
get_logger attaches a logging.NullHandler to every RedisVL logger (redisvl/utils/log.py). Since Python 3.2, a WARNING or higher record with no handler anywhere in the logger hierarchy goes to logging.lastResort, which prints it to stderr. A NullHandler counts as a handler, so it opts every RedisVL logger out of that fallback and the record is dropped.
That affects every get_logger call site in the library (22 on main). The most consequential is the warning #742 added for a vector field that from_existing cannot parse: the recovered schema is missing that field, and recreating the index from it drops the field. In the issue's own setting, a plain script with no logging configuration, the warning is never shown. The test for it passes only because pytest's caplog installs its own handler.
Reproduction
import logging
from redisvl.utils.log import get_logger
get_logger("redisvl.demo").warning("from redisvl logger")
logging.getLogger("plain.demo").warning("from plain logger")
On main, with Python 3.13, only from plain logger is printed. After logging.basicConfig(), the RedisVL warning appears.
Expected behaviour
With no logging configuration, RedisVL warnings and errors reach stderr through lastResort, as a standard-library logger's do. An application that configures logging is unaffected either way.
Proposed fix
Stop attaching the NullHandler in get_logger. It was only needed to silence the "No handlers could be found" message on Python 2 and early Python 3. It does not configure the root logger, so this keeps the behaviour that #443 and #445 asked for.
- Lenguaje dominante
- Python
- Estrellas
- 432
- Forks
- 111
- Merge medio
- 5 d 22 h
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de redis/redis-vl-python
-
from_existing fails on SVS-VAMANA indexes created without compressionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug index
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
redis/redis-vl-python#787 ·
Los mantenedores suelen responder en 4 días
-
exists() depends on exact FT.INFO error wording; an unrecognised "missing index" message makes create() never create the index (regression from #672)Posiblemente ocupada @nandanadileep la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
redis/redis-vl-python#773 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Vector field with index_missing=True cannot be createdPosiblemente ocupada @RaphaelFakhri la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
redis/redis-vl-python#770 ·
Los mantenedores suelen responder en 4 días
-
Add Python 3.15 supportPosiblemente ocupada @vishal-bala la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
redis/redis-vl-python#757 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 4 días
-
SearchIndex.drop_keys does not validate cluster hash-tag co-location (inconsistent with drop_documents)Posiblemente ocupada @Hashim1999164 la tomó hace 9 días. Abiertobug good first issue index
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
redis/redis-vl-python#601 ·
Los mantenedores suelen responder en 4 días
Todos los issues de redis/redis-vl-python
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
521xueweihan/HelloGitHub#4150 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
aws-samples/sample-per-model-bedrock#595 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug connectors
Dificultad 1/5 Menos de una hora Aptitud para principiantes 67/100
pyinfra-dev/pyinfra#2036 ·
Los mantenedores suelen responder en 9 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día