Unexpected behavior from RedisDsn + BaseSettings #9217
kfreezen
started this conversation in
Pydantic V2
Replies: 1 comment 1 reply
-
I'll leave my blunder with the redis library up for everyone to see. I discovered I needed to use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Code with unexpected behavior
Output:
I would have expected
RedisDsn(...)
to give the same output asSettings().redis_uri
. Is there a reason that this is not the case?I would also like to point out that passing
str(settings.redis_uri)
toredis.asyncio.Redis
causes it to choke because it seems their URL parsing is faulty. I'm surprised no-one else has run into this issue. They append:6379/0
for a beautiful URL ofredis://redis:6379/0:6379/0
.It is very possible, of course, that I'm doing something wrong.
Beta Was this translation helpful? Give feedback.
All reactions