You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem appears to be a mismatch between https://github.com/basho/riak-python-client/blob/master/riak/transports/http/transport.py#L733 and the _check_type methods for each datatype. The PBC transport's codec seems happy creating default python values and filling them in as it decodes, so _check_type gets the right type, even if it's an empty value. But the HTTP transport just blindly throws a None out if it gets a 404 while fetching, causing _check_type to choke, as None is not iterable.
I'm not sure if the right fix is to make each _check_type treat None appropriately, or to make fetch_datatype smarter about returning the appropriate empty set/dict/str/etc, but I definitely think the PBC transport's behavior is more in line with both the documentation and the expected behavior.
The text was updated successfully, but these errors were encountered:
Basho-JIRA
changed the title
Inconsistent datatype reload() behavior between PBC and HTTP.
Inconsistent datatype reload() behavior between PBC and HTTP. [JIRA: CLIENTS-811]
Mar 24, 2016
Python 2.7, using riak-python-client 2.4.2:
Attempting to
reload()
a new or nonexistent Map datatype raises an Exception when using HTTP transport, but works when using Protobufs:Set fails with different but similar exception:
The problem appears to be a mismatch between https://github.com/basho/riak-python-client/blob/master/riak/transports/http/transport.py#L733 and the
_check_type
methods for each datatype. The PBC transport's codec seems happy creating default python values and filling them in as it decodes, so_check_type
gets the right type, even if it's an empty value. But the HTTP transport just blindly throws aNone
out if it gets a 404 while fetching, causing_check_type
to choke, asNone
is not iterable.I'm not sure if the right fix is to make each
_check_type
treatNone
appropriately, or to makefetch_datatype
smarter about returning the appropriate empty set/dict/str/etc, but I definitely think the PBC transport's behavior is more in line with both the documentation and the expected behavior.The text was updated successfully, but these errors were encountered: