Giter Site home page Giter Site logo

Comments (3)

dev01-esserweb avatar dev01-esserweb commented on May 18, 2024 1

Thank you so much, my Redis version is 3.2 🤡
I think this is it, I'll upgrade my Redis version

from pottery.

brainix avatar brainix commented on May 18, 2024

Hi, @dev01-esserweb.

Thanks for the bug report. I've tried your example myself, and it works for me; I can't reproduce:

>>> from redis import Redis
>>> from pottery import RedisDict
>>> class RedisContext:
...     def __init__(self):
...         self.redis = Redis.from_url("redis://localhost:6379/0")
...     def __enter__(self):
...         return self.redis
...     def __exit__(self, exc_type, exc_value, traceback):
...         self.redis.close()
... 
>>> with RedisContext() as redis:
...     tel = RedisDict({'jack':4098, 'sape':4139}, redis=redis, key='tel')
... 
>>> print(tel)
RedisDict{'jack': 4098, 'sape': 4139}

I also test my doctests in the README and in the code:

rajiv.shah@C02FK16KMD6V pottery % make doctest
source venv/bin/activate && python3 -m doctest README.md
Self-assigning tmp key <RedisSet key='pottery:4WXckcQVpZhDWt4e'>
Deleted tmp <RedisSet key='pottery:4WXckcQVpZhDWt4e'> (instance is about to be destroyed)
Self-assigning tmp key <RedisSet key='pottery:4YCLmGuYVjXHKFZ6'>
Deleted tmp <RedisSet key='pottery:4YCLmGuYVjXHKFZ6'> (instance is about to be destroyed)
Self-assigning tmp key <RedisSet key='pottery:RuGPNctfv91rGccX'>
Deleted tmp <RedisSet key='pottery:RuGPNctfv91rGccX'> (instance is about to be destroyed)
Self-assigning tmp key <RedisSet key='pottery:M3TfuJthsJRgXkYD'>
Self-assigning tmp key <RedisSet key='pottery:wsQqjtfeg7eNGAeU'>
Self-assigning tmp key <RedisSet key='pottery:6zF3kgcZBvLOZ0DJ'>
Deleted tmp <RedisSet key='pottery:M3TfuJthsJRgXkYD'> (instance is about to be destroyed)
Deleted tmp <RedisSet key='pottery:wsQqjtfeg7eNGAeU'> (instance is about to be destroyed)
Deleted tmp <RedisSet key='pottery:6zF3kgcZBvLOZ0DJ'> (instance is about to be destroyed)
Self-assigning tmp key <RedisList key='pottery:kceLbvGaMRPTS3xE'>
Deleted tmp <RedisList key='pottery:kceLbvGaMRPTS3xE'> (instance is about to be destroyed)
Self-assigning tmp key <RedisDeque key='pottery:79NE2NBpSUloBNfJ'>
Deleted tmp <RedisDeque key='pottery:79NE2NBpSUloBNfJ'> (instance is about to be destroyed)
TEST_DOCTESTS=1 make test tests=tests.test_doctests.DoctestTests.test_doctests
source venv/bin/activate && \
		python3 -m unittest --verbose tests.test_doctests.DoctestTests.test_doctests
test_doctests (tests.test_doctests.DoctestTests)
Run doctests and confirm that they work and are not science fiction ... ok

----------------------------------------------------------------------
Ran 1 test in 47.618s

OK

I wonder if there was something else going on when you tried it? Can you provide any additional information that might help me diagnose what was happening when you tried it?

Thanks,
Raj

from pottery.

brainix avatar brainix commented on May 18, 2024

Hi, @dev01-esserweb.

I did a little Googling and I may have found something... Are you running Redis < 4.0.0? It looks like HSET can handle multiple field/value pairs only as of Redis 4.0.0.

Source: https://redis.io/commands/hset

Thanks,
Raj

from pottery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.