splunk / splunk/splunk-sdk-python
JSONResultsReader iterator called on oneshot search does not iterate with for loop.
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 743
- フォーク
- 387
- 平均マージ
- 42分
- マージ済み PR(30日)
- 4
説明
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)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100