Skip to content

fix JSON stats view and tests with redis-py 6.0 #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

terencehonles
Copy link
Contributor

@terencehonles terencehonles commented May 2, 2025

@terencehonles terencehonles force-pushed the fix-redis-py-retry-change branch 2 times, most recently from c2e9a28 to 1e6ac48 Compare May 2, 2025 07:36
@terencehonles terencehonles changed the title fix JSON serializer and tests with redis-py 6.0 fix JSON stats view and tests with redis-py 6.0 May 2, 2025
connection_kwargs.pop('connection_pool', None)
connection_kwargs.pop('parser_class', None)
connection_kwargs.pop('retry', None)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to try to serialize this?

Comment on lines 11 to 14
special_case_retry = False
if (retry := connection_kwargs.get('retry')) and retry.__class__.__eq__ == object.__eq__:
special_case_retry = True
del connection_kwargs['retry']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special casing can be removed if redis/redis-py#3628 is accepted and released in a minor / point release and we don't need to support all previous releases (or the support for 6.0 is dropped, which will probably be in a long time)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like your PR was merged yesterday. redis/redis-py#3628 . Should we just wait for redis-py 6.0.1 to be released before merging this in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, not sure how long that will be

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I might just exclude redis-py 6.0 from dependency. Will cut a release soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this to not have the workaround then. I'm assuming you will have something like redis-py!=6.0.0 in the dependency specifiers, so that when 6.0.1 is released this will work properly still.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I merged this in just a few minutes ago: rq/rq#2244

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I updated this PR for you

@terencehonles terencehonles force-pushed the fix-redis-py-retry-change branch 2 times, most recently from 26fdc80 to 1fc2df7 Compare May 12, 2025 14:01
@terencehonles terencehonles force-pushed the fix-redis-py-retry-change branch from 1fc2df7 to a1c3093 Compare May 12, 2025 14:01
queue_index = i
break
return queue_index
if q.name == name:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this to only check the name, since this method was skipping the queue (and breaking on an IndexError if the connection wasn't the "same")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants