Skip to content

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
# remove unneeded properties which are not serializable in JSON
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")

@selwin selwin merged commit 1c23862 into rq:master May 31, 2025
17 checks passed
@selwin
Copy link
Collaborator

selwin commented May 31, 2025

Thanks!

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