-
Notifications
You must be signed in to change notification settings - Fork 550
Fix CI, adapt to new redis-py release #4431
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
Merged
+26
−24
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1843488
Test CI
sentrivana 64ffbf0
just remove the fixture
sentrivana e7dcb1f
new mypy
sentrivana b201264
redis
sentrivana 271b148
this has also changed
sentrivana d238532
fix
sentrivana f30f9e3
simplify
sentrivana ed923de
mypy
sentrivana d27bb10
.
sentrivana 5ea53e8
mypy
sentrivana 3d45ded
.
sentrivana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,13 +41,21 @@ async def _sentry_execute(self, *args, **kwargs): | |
origin=SPAN_ORIGIN, | ||
) as span: | ||
with capture_internal_exceptions(): | ||
try: | ||
command_seq = self._execution_strategy._command_queue | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redis-py PR that introduced this |
||
except AttributeError: | ||
if is_cluster: | ||
command_seq = self._command_stack | ||
else: | ||
command_seq = self.command_stack | ||
|
||
set_db_data_fn(span, self) | ||
_set_pipeline_data( | ||
span, | ||
is_cluster, | ||
get_command_args_fn, | ||
False if is_cluster else self.is_transaction, | ||
self._command_stack if is_cluster else self.command_stack, | ||
command_seq, | ||
) | ||
|
||
return await old_execute(self, *args, **kwargs) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,11 +36,19 @@ def _set_async_cluster_db_data(span, async_redis_cluster_instance): | |
def _set_async_cluster_pipeline_db_data(span, async_redis_cluster_pipeline_instance): | ||
# type: (Span, AsyncClusterPipeline[Any]) -> None | ||
with capture_internal_exceptions(): | ||
client = getattr(async_redis_cluster_pipeline_instance, "cluster_client", None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redis-py PR that introduced this |
||
if client is None: | ||
# In older redis-py versions, the AsyncClusterPipeline had a `_client` | ||
# attr but it is private so potentially problematic and mypy does not | ||
# recognize it - see | ||
# https://github.com/redis/redis-py/blame/v5.0.0/redis/asyncio/cluster.py#L1386 | ||
client = ( | ||
async_redis_cluster_pipeline_instance._client # type: ignore[attr-defined] | ||
) | ||
|
||
_set_async_cluster_db_data( | ||
span, | ||
# the AsyncClusterPipeline has always had a `_client` attr but it is private so potentially problematic and mypy | ||
# does not recognize it - see https://github.com/redis/redis-py/blame/v5.0.0/redis/asyncio/cluster.py#L1386 | ||
async_redis_cluster_pipeline_instance._client, # type: ignore[attr-defined] | ||
client, | ||
) | ||
|
||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mypy was complaining because of
environment
andrelease
potentially beingNone
here