JSONResultsReader iterator called on oneshot search does not iterate with for loop.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by reproducing the provided JSONResultsReader snippet with both oneshot and normal searches, then inspect the JSONResultsReader iterator entry point and any existing tests. Done means a reader from a oneshot search supports direct for-loop iteration without first converting it to a list, with coverage for the differing search modes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
JSONResultsReader iterator called on oneshot search does not iterate with for loop.
To Reproduce
-run a oneshot search, the notice the for content/command[s] fails.
reader = JSONResultsReader(result_stream)
for item in reader:
print(item)
Expected behavior
iterate through the results and take action on.
Logs or Screenshots
If applicable, add logs or screenshots to help explain your problem.
Splunk (please complete the following information):
- Version: Splunk Enterprise 9.1.1
- OS: Rocky Linux 9.6
- Deployment: Distributed/Clustered SH's and IDX's architecture
SDK (please complete the following information):
- Version: [2.1.0 and 2.1.1]
- Language Runtime Version: Python 3.12.3
- OS: Ubuntu 24.04.2 LTS
Additional context
This issue is only impacting the "oneshot" type search, with "normal" type search successfully yields an iterable "reader" for reader = JSONResultsReader(result_stream).
The workaround is to do:
reader = JSONResultsReader(result_stream)
reader2 = list(reader)
for item in reader2:
print(item)
- Lingua principale
- Python
- Stelle
- 743
- Fork
- 387
- Merge medio
- 42m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di splunk/splunk-sdk-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
splunk/splunk-sdk-python#835 · 1 commento · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
splunk/splunk-sdk-python#831 · 1 commento ·
-
Unverified SSL context Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
splunk/splunk-sdk-python#704 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
splunk/splunk-sdk-python#840 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
splunk/splunk-sdk-python#828 ·
Tutte le issue di splunk/splunk-sdk-python
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
zostera/django-bootstrap4#894 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
use-agent-os/agent-os#3276 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NousResearch/hermes-agent#117848 ·