Empty accelerated fields leads to TypeError

Aberta
#677 0 comentários 0 reações 1 responsável Ver no GitHub

@Ickerday já está trabalhando nisso.

Desde 13/11/2025.

Avaliação

Esta issue ainda não foi avaliada.

Descrição

bug KV Store

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.

Linguagem predominante
Python
Estrelas
743
Forks
387
Merge médio
42min
PRs com merge (30d)
4

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de splunk/splunk-sdk-python

Todas as issues de splunk/splunk-sdk-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.