-
Notifications
You must be signed in to change notification settings - Fork 30
Description
The Problem
For list_ functions, there is no consistent return type. Some return a dict formatted as:
{'key': [{foo}, {bar}]}Examples:
ChronicleClient.list_rules()ChronicleClient.list_dashboards()
Where others return a list of results:
[{foo}, {bar}]Examples:
ChronicleClient.list_data_tables()ChronicleClient.list_feeds()
This inconsistency makes it harder for users to predict function behaviour and integrate results smoothly.
Potential Solution
Adopt a standard return type for all list operations.
Recommendation: Return a flat list whenever possible. This approach:
- Aligns with common Python SDK conventions
- Keeps results predictable and iterable
- Works naturally with built-in operations like slicing and filtering
To ensure consistency, a shared utility function could be introduced to handle list responses. Additionally, a centralised paginated_request helper will standardise pagination logic across modules.
Potential Impact
This could be a breaking change for current users of the SDK that are using functions currently returning dictionaries. Considering the project still hasn’t had a major release, this may be an acceptable/expected disruption.