splunk / splunk/splunk-sdk-python

Empty accelerated fields leads to TypeError

Aperta
#677 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@Ickerday ci sta già lavorando.

Dal 13/11/2025.

bug KV Store
Lingua principale
Python
Stelle
743
Fork
387
Merge medio
42m
PR unite (30g)
4

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.