Skip to content

Change describe to return a dict mapping channel names to Channels

Patrick Godwin requested to merge patrick.godwin/arrakis-python:api_tweaks into main

Given that describe is used to describe channels, and is passed in a list of channels, I don't think it makes much sense that the return type is unordered. Also, I imagine this will be used in the most part to describe a small set of channels so collecting the results client-side and returning it as a collection seems reasonable.

Given this, I've changed the return type from a generator of Channel to dict[str, Channel], in a similar spirit to fetch/stream which takes in a list of channels and returns the result as a dictionary-like object that can be keyed by the channel name. I found it easier to work with here. This also won't have any client-server performance impact.

Merge request reports

Loading