Comments (5)
That's odd, I don't see anything about it's removal in the changelog and it is still documented here:
Still here, too:
https://github.com/redis/redis-py/blob/master/redis/commands/core.py#L5379
Can you verify? Try importing the plain old redis client?
from walrus.
This is working fine for me:
In [1]: from walrus import *
In [2]: db = Database()
In [3]: db.register_script?
Signature: db.register_script(script: Union[bytes, str, memoryview]) -> redis.commands.core.Script
Docstring:
Register a Lua ``script`` specifying the ``keys`` it will touch.
Returns a Script object that is callable and hides the complexity of
deal with scripts, keys, and shas. This is the preferred way to work
with Lua scripts.
File: ~/testenv/lib/python3.7/site-packages/redis/commands/core.py
Type: method
In [4]: from redis import __version__
In [5]: __version__
Out[5]: '5.0.0'
from walrus.
I don't know what explains the difference, but I also had trouble with redis-py v5 and walrus. Here is a traceback
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/<...>:520: in _reset
13:41:49 self._walrus_db = walrus.Database(*self._walrus_args, **self._walrus_kwargs)
13:41:49 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
13:41:49
13:41:49 self = <walrus.database.Database object at 0x7ffc3c13ebb0>, args = ()
13:41:49 kwargs = {'host': 'redis1', 'port': '6379', 'retry_on_timeout': True}
13:41:49 script_dir = None
13:41:49
13:41:49 def __init__(self, *args, **kwargs):
13:41:49 """
13:41:49 :param args: Arbitrary positional arguments to pass to the
13:41:49 base ``Redis`` instance.
13:41:49 :param kwargs: Arbitrary keyword arguments to pass to the
13:41:49 base ``Redis`` instance.
13:41:49 :param str script_dir: Path to directory containing walrus
13:41:49 scripts. Use "script_dir=False" to disable loading any scripts.
13:41:49 """
13:41:49 script_dir = kwargs.pop('script_dir', None)
13:41:49 > super(Database, self).__init__(*args, **kwargs)
13:41:49 E TypeError: object.__init__() takes exactly one argument (the instance to initialize)
This is inside a docker container from centos7 (!) during a conda build for our library (which explains the placehold stuff), and using pytest.
- python 3.8.18
- redis 5.0.1
- walrus 0.9.3
In my local dev environment, with the same versions listed but not during conda build and using ubuntu 20.04, I got
Exception ignored in: <function Redis.__del__ at 0x7f060f339310>
Traceback (most recent call last):
File "<...>lib/python3.8/site-packages/redis/client.py", line 491, in __del__
self.close()
File "<...>lib/python3.8/site-packages/redis/client.py", line 506, in close
self.connection_pool.disconnect()
AttributeError: 'Database' object has no attribute 'connection_pool'
Both are fixed by specifying redis-py<5
from walrus.
On second thought, it could be purely redis-py changes and nothing to do with this library
from walrus.
It seems OK to me on master
for both:
>>> import redis
>>> redis.__version__
'5.1.0b3'
>>> from walrus import *
>>> db = Database()
>>> db.set('k1', 'v1')
True
>>> db.get('k1')
b'v1'
>>> db.close()
>>> del db
All tests are passing as well.
from walrus.
Related Issues (20)
- cache.cached doesn't work if the function returns None HOT 1
- "lock.event:" pollution HOT 2
- [feature]Any plan for supporting model relationship mapping? HOT 1
- Consumer group pending exception HOT 1
- VSCode type checking can't identify RedisPy's Redis as parent HOT 2
- Database() is falsy when database is empty HOT 2
- Empty queries in graph HOT 1
- A problem with query in graph.py HOT 1
- Lock event keys never expire HOT 1
- There is a problem. HOT 3
- Walrus Support for Redis Python Client 4.x+ HOT 2
- Is Expiring Hashes supported in Walrus? HOT 3
- Missing argument in method calling
- Support from_url database connection HOT 2
- Extending Containers with custom behavior HOT 1
- examples in docs use Python 2 syntax
- Handling json HOT 3
- regex error HOT 1
- regex syntax warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from walrus.