Empty accelerated fields leads to TypeError
@Ickerday is already working on this.
Since Nov 13, 2025.
Assessment
This issue has not been assessed yet.
Description
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.
- Dominant language
- Python
- Stars
- 743
- Forks
- 387
- Avg merge
- 42m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from splunk/splunk-sdk-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
splunk/splunk-sdk-python#835 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
splunk/splunk-sdk-python#831 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
splunk/splunk-sdk-python#704 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
splunk/splunk-sdk-python#840 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
splunk/splunk-sdk-python#828 ·
All issues in splunk/splunk-sdk-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100