Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Improve emulation of redis -> Lua returns #13

Merged
merged 3 commits into from
Feb 20, 2018
Merged

Commits on Feb 19, 2018

  1. Improve emulation of redis -> Lua returns

    There were some cases omitted from _convert_redis_result e.g.
    recursively converting lists. A more serious problem is that
    fakenewsredis follows the types returned by redis-py, which in many
    cases have a command-specific conversion applied e.g. EXISTS returns
    bool instead of 0/1. Since in real redis the Lua script is not subject
    to these conversions, we need to "undo" them.
    
    In some cases this can be done generically e.g. bool -> int or float ->
    str, but in others we need command-specific conversions. This is done
    with the `@_lua_reply` decorator.
    
    There is probably more work needed to handle all the commands: redis-py
    has a large table of conversions, and I've only handled some of the
    common cases.
    
    Also fixed flushall to return True (independently of Lua).
    bmerry committed Feb 19, 2018
    Configuration menu
    Copy the full SHA
    46ac71a View commit details
    Browse the repository at this point in the history
  2. Flake8 fixups

    bmerry committed Feb 19, 2018
    Configuration menu
    Copy the full SHA
    c44ae5e View commit details
    Browse the repository at this point in the history
  3. Sort sets when returned into Lua

    This is to match redis's documented behaviour of sorting some arrays
    when Lua fetches them, to make scripts deterministic.
    bmerry committed Feb 19, 2018
    Configuration menu
    Copy the full SHA
    2788f83 View commit details
    Browse the repository at this point in the history