-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor public APIs and remove format_return option (#31)
* Refactor public APIs and remove format_return option We have decided to remove the format_return option, and I have done that in this PR. While doing that, I have noticed some deviations from the redis [spec](https://github.com/redis/redis/tree/unstable/src/commands) regarding the parameter names and some return values. I have updated some parameter names according to the spec. Also, there were some inconsistencies (some methods were returing "OK" for simple string responses while others were returning boolean) regarding the return types, so I have fixed them as well. I have also refactored some of the public APIs related to geo commands. It was cumbersome to use dict as the variadic parameter values so I converted most of them to simple tuples. * rename run to execute * do not export async redis from the __init__.py
- Loading branch information
Showing
100 changed files
with
1,456 additions
and
2,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from pytest import mark | ||
|
||
from upstash_redis import AsyncRedis | ||
from upstash_redis.asyncio import Redis | ||
|
||
|
||
@mark.asyncio | ||
async def test(async_redis: AsyncRedis) -> None: | ||
async def test(async_redis: Redis) -> None: | ||
assert await async_redis.getbit(key="string", offset=1) == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
from pytest import mark | ||
|
||
from tests.execute_on_http import execute_on_http | ||
from upstash_redis import AsyncRedis | ||
from upstash_redis.asyncio import Redis | ||
|
||
|
||
@mark.asyncio | ||
async def test(async_redis: AsyncRedis) -> None: | ||
async def test(async_redis: Redis) -> None: | ||
assert await async_redis.setbit("setbit", offset=4, value=1) == 0 | ||
|
||
assert await execute_on_http("GETBIT", "setbit", "4") == 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from pytest import mark | ||
|
||
from upstash_redis import AsyncRedis | ||
from upstash_redis.asyncio import Redis | ||
|
||
|
||
@mark.asyncio | ||
async def test(async_redis: AsyncRedis) -> None: | ||
async def test(async_redis: Redis) -> None: | ||
assert await async_redis.echo(message="Upstash is nice!") == "Upstash is nice!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
from pytest import mark | ||
|
||
from upstash_redis import AsyncRedis | ||
from upstash_redis.asyncio import Redis | ||
|
||
|
||
@mark.asyncio | ||
async def test(async_redis: AsyncRedis) -> None: | ||
async def test(async_redis: Redis) -> None: | ||
assert await async_redis.ping() == "PONG" | ||
|
||
|
||
@mark.asyncio | ||
async def test_with_message(async_redis: AsyncRedis) -> None: | ||
async def test_with_message(async_redis: Redis) -> None: | ||
assert await async_redis.ping(message="Upstash is nice!") == "Upstash is nice!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.