Sage-Bionetworks / synapsePythonClient

Programmatic interface to Synapse services for Python
https://www.synapse.org
Apache License 2.0
67 stars 68 forks source link

[SYNPY-1344] Creating a decorator to be used in async class methods #1049

Closed BryanFauble closed 8 months ago

BryanFauble commented 8 months ago

Problem:

  1. The default OTEL decorator does not work as expected in Async environments. It will only capture when the method is created but not capture the entire execution of the method.
  2. We were required to use a context manager in the function leading to more complex code.

Solution:

  1. I created a new decorator that will allow us to decorate these class methods. In the future I'll plan to create other decorators for async functions too.

Testing:

  1. I verified that the name of the functions were correctly shown: image image image
pep8speaks commented 8 months ago

Hello @BryanFauble! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 13:89: E501 line too long (89 > 88 characters) Line 22:89: E501 line too long (105 > 88 characters) Line 26:89: E501 line too long (92 > 88 characters)

Line 164:89: E501 line too long (104 > 88 characters) Line 181:89: E501 line too long (92 > 88 characters)

Line 151:89: E501 line too long (92 > 88 characters)

Line 230:89: E501 line too long (100 > 88 characters)

Line 314:89: E501 line too long (92 > 88 characters) Line 473:89: E501 line too long (101 > 88 characters)

Comment last updated at 2024-01-23 20:33:52 UTC
sonarcloud[bot] commented 8 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
0.0% Coverage on New Code
5.3% Duplication on New Code

See analysis details on SonarCloud