Existing Behavior:
When fetching data and using a sort key that only exists on some items fetched, a KeyError will be raised.
New Behavior:
Missing keys are sorted first to maintain consistency with the official firebase libraries.
A tuple is returned to the sorted function. The first key will be a boolean and the second key will be the value of the sort key or an empty string.
If the sort key is missing, the first key in the tuple will be False and ordered first which is the behavior documented in the official firebase documentation. The second key in the tuple will be an empty string giving all items without a sort key equal weighting.
If the sort key is available, the first key in the tuple will be true and the second value will be the value of the sort key to sort on.
Existing Behavior: When fetching data and using a sort key that only exists on some items fetched, a
KeyError
will be raised.New Behavior: Missing keys are sorted first to maintain consistency with the official firebase libraries.
A tuple is returned to the sorted function. The first key will be a boolean and the second key will be the value of the sort key or an empty string.
If the sort key is missing, the first key in the tuple will be
False
and ordered first which is the behavior documented in the official firebase documentation. The second key in the tuple will be an empty string giving all items without a sort key equal weighting.If the sort key is available, the first key in the tuple will be true and the second value will be the value of the sort key to sort on.