splunk / splunk/splunk-sdk-python

Empty accelerated fields leads to TypeError

Abierto
#677 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@Ickerday ya está trabajando en esto.

Desde el 13/11/2025.

bug KV Store
Lenguaje dominante
Python
Estrellas
743
Forks
387
Merge medio
42 min
PR fusionados (30 d)
4

Descripción

Describe the bug

def __getitem__(self, item):
        res = Collection.__getitem__(self, item)
        for k, v in res.content.items():
            if "accelerated_fields" in k:
                res.content[k] = json.loads(v)
        return res

This code breaks if v is not a valid JSON string.
As there is no way to remove an acceleration other than setting it to empty, this is a typical case.

To Reproduce
Steps to reproduce the behaviour:

c.kvstore.create("test")
collection = c.kvstore["test"]
collection.update_accelerated_field("test", {"test": 1})
collection = c.kvstore["test"]
collection.update_accelerated_field("test", "")
collection = c.kvstore["test"]

Expected behaviour
Rather than an exception, the empty string is used as the value.

If I am allowed to dream, splunkd should provide a mechanism to remove accelerations and field configurations cleanly. However, this bug should still be fixed, as we never know what administrators might write in .conf files.

Guía de contribución

Abrir la guía de contribución

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.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.