Empty accelerated fields leads to TypeError
@Ickerday đang làm issue này rồi.
Từ ngày 13/11/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 743
- Fork
- 387
- Merge trung bình
- 42 phút
- Pull request đã merge (30 ngày)
- 4
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của splunk/splunk-sdk-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
splunk/splunk-sdk-python#835 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
splunk/splunk-sdk-python#831 · 1 bình luận ·
-
Unverified SSL context Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
splunk/splunk-sdk-python#704 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
splunk/splunk-sdk-python#840 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
splunk/splunk-sdk-python#828 ·
Tất cả issue của splunk/splunk-sdk-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100