Skip to content

Commit ea61c91

Browse files
committed
Fix: Remove bulk_service_stream (bulk only works for leaks)
1 parent beb7185 commit ea61c91

2 files changed

Lines changed: 0 additions & 41 deletions

File tree

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,6 @@ def example_bulk_stream():
212212
print(event.ip)
213213

214214

215-
def example_bulk_service_stream():
216-
"""
217-
Streaming bulk service - memory efficient for large datasets.
218-
"""
219-
query = MustQuery(field=PluginField(Plugin.GitConfigHttpPlugin))
220-
for event in CLIENT.bulk_service_stream(queries=[query]):
221-
print(event.ip)
222-
223-
224215
if __name__ == "__main__":
225216
example_get_host_filter_plugin()
226217
example_get_service_filter_plugin()
@@ -234,5 +225,4 @@ if __name__ == "__main__":
234225
example_search_service()
235226
example_get_domain()
236227
example_bulk_stream()
237-
example_bulk_service_stream()
238228
```

leakix/client.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -314,34 +314,3 @@ def bulk_export_stream(self, queries: list[Query] | None = None):
314314
yield l9format.L9Aggregation.from_dict(json_event)
315315
except Exception:
316316
pass
317-
318-
def bulk_service_stream(self, queries: list[Query] | None = None):
319-
"""
320-
Streaming version of bulk_service. Yields L9Event objects one by one.
321-
322-
This is more memory efficient for large result sets as it doesn't load
323-
all results into memory at once.
324-
325-
Example:
326-
>>> for event in client.bulk_service_stream([MustQuery(PluginField(Plugin.GitConfigHttpPlugin))]):
327-
... print(event.ip)
328-
"""
329-
url = f"{self.base_url}/bulk/service"
330-
if queries is None or len(queries) == 0:
331-
serialized_query = EmptyQuery().serialize()
332-
else:
333-
serialized_query = [q.serialize() for q in queries]
334-
serialized_query = " ".join(serialized_query)
335-
serialized_query = f"{serialized_query}"
336-
params = {"q": serialized_query}
337-
r = requests.get(url, params=params, headers=self.headers, stream=True)
338-
if r.status_code != 200:
339-
return
340-
for line in r.iter_lines():
341-
if not line:
342-
continue
343-
try:
344-
json_event = json.loads(line)
345-
yield l9format.L9Event.from_dict(json_event)
346-
except Exception:
347-
pass

0 commit comments

Comments
 (0)