Skip to content

Commit 0baf8d5

Browse files
lrafeeibc291mergify[bot]ahmedhr
authored
Develop swap redis asyncio commits (#913)
* Revert "Redis asyncio testing (#881)" (#911) * Revert "Redis asyncio testing (#881)" This reverts commit 05cff1b. * Add spublish to list of commands * Fix redis.asyncio sync operations wrapper (#782) * Fix redis.asyncio sync operations wrapper * Add clean ups * Fixes: - `loop` -> noqa - catch `TimeoutError` on `asyncio.timeout` * Added separate instrumentation for redis.asyncio.client (#808) * Added separate instrumentation for redis.asyncio.client Merge main branch updates Add tests for newrelic/config.py (#860) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Modify redis tests * removed redis.asyncio from aioredis instrumentation removed aioredis instrumentation in redis asyncio client removed redis.asyncio from aioredis instrumentation --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Lalleh Rafeei <[email protected]> Co-authored-by: Lalleh Rafeei <[email protected]> * Modify tests * Tweak tests and instrumentation * Tweak tests to separate aioredis and redis.asyncio * Correctly separate commands to sync/async --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Ahmed <[email protected]> Co-authored-by: Lalleh Rafeei <[email protected]> Co-authored-by: Lalleh Rafeei <[email protected]> * Remove formatting in import --------- Co-authored-by: Błażej Cyrzon <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Ahmed <[email protected]>
1 parent 3988ecc commit 0baf8d5

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

newrelic/hooks/datastore_aioredis.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
from newrelic.api.datastore_trace import DatastoreTrace
1615
from newrelic.api.time_trace import current_trace
1716
from newrelic.api.transaction import current_transaction
@@ -60,6 +59,7 @@ def _nr_wrapper_AioRedis_method_(wrapped, instance, args, kwargs):
6059
# Method will return synchronously without executing,
6160
# it will be added to the command stack and run later.
6261
aioredis_version = get_package_version_tuple("aioredis")
62+
6363
# This conditional is for versions of aioredis that are outside
6464
# New Relic's supportability window but will still work. New
6565
# Relic does not provide testing/support for this. In order to
@@ -139,7 +139,6 @@ async def wrap_Connection_send_command(wrapped, instance, args, kwargs):
139139
):
140140
return await wrapped(*args, **kwargs)
141141

142-
143142
# This wrapper is for versions of aioredis that are outside
144143
# New Relic's supportability window but will still work. New
145144
# Relic does not provide testing/support for this. In order to

newrelic/hooks/datastore_redis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from newrelic.api.transaction import current_transaction
1919
from newrelic.common.object_wrapper import function_wrapper, wrap_function_wrapper
2020

21+
2122
_redis_client_sync_methods = {
2223
"acl_dryrun",
2324
"auth",
@@ -612,7 +613,6 @@ def instrument_asyncio_redis_client(module):
612613
if hasattr(class_, operation):
613614
_wrap_asyncio_Redis_method_wrapper(module, "Redis", operation)
614615

615-
616616
def instrument_redis_commands_core(module):
617617
_instrument_redis_commands_module(module, "CoreCommands")
618618

tests/datastore_aioredis/test_execute_command.py

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
# limitations under the License.
1414

1515
import pytest
16-
17-
# import aioredis
1816
from conftest import AIOREDIS_VERSION, loop # noqa # pylint: disable=E0611,W0611
1917
from testing_support.db_settings import redis_settings
2018
from testing_support.fixtures import override_application_settings

tests/datastore_redis/test_asyncio.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ async def _test_pubsub():
104104
await future
105105

106106
loop.run_until_complete(_test_pubsub())
107-
assert messages_received == ["Hello", "World", "NOPE"]
107+
assert messages_received == ["Hello", "World", "NOPE"]

0 commit comments

Comments
 (0)