@@ -23,14 +23,11 @@ def patch():
2323 _xray_register_type_fix
2424 )
2525
26- # We should in general not patch internal methods (pyscopg2._json.register_type in this case).
27- # But there isn't a better workaround than this for the time being.
28- # Please see the GH issue for details: https://github.com/aws/aws-xray-sdk-python/issues/243
29- wrapt .wrap_function_wrapper (
30- 'psycopg2._json' ,
31- 'register_type' ,
32- _xray_register_type_fix
33- )
26+ # wrapt.wrap_function_wrapper(
27+ # 'psycopg2.extras',
28+ # 'register_default_jsonb',
29+ # _xray_register_default_jsonb_fix
30+ # )
3431
3532
3633def _xray_traced_connect (wrapped , instance , args , kwargs ):
@@ -59,3 +56,14 @@ def _xray_register_type_fix(wrapped, instance, args, kwargs):
5956 our_args [1 ] = our_args [1 ].__wrapped__
6057
6158 return wrapped (* our_args , ** kwargs )
59+
60+
61+ # def _xray_register_default_jsonb_fix(wrapped, instance, args, kwargs):
62+ # our_kwargs = dict()
63+ # for key, value in kwargs.items():
64+ # if key == "conn_or_curs" and isinstance(value, (XRayTracedConn, XRayTracedCursor)):
65+ # # unwrap the connection or cursor to be sent to register_default_jsonb
66+ # value = value.__wrapped__
67+ # our_kwargs[key] = value
68+ #
69+ # return wrapped(*args, **our_kwargs)
0 commit comments