Skip to content

Commit e36de1e

Browse files
committed
docs(jira): show both client call forms in the class docstring
The class docstring still demonstrated the pre-syncify async call, which no longer works as written. It now shows the async form with .aio() and the blocking form under a plain `with`, and says which belongs where. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VKZrTNjjWVzTZUxDFbn4Nk Signed-off-by: Niels Bantilan <niels.bantilan@gmail.com>
1 parent f9bf3bf commit e36de1e

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

plugins/jira/src/flyteplugins/jira/_client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,22 @@ def _simplify_issue(issue: dict[str, Any], base_url: str = "") -> dict[str, Any]
102102
class JiraClient:
103103
"""Async client for the Jira Cloud REST API v3.
104104
105-
Use as an async context manager:
105+
Every method has two call forms. Use the async one on an event loop — in
106+
`async def` tasks, app handlers, and MCP tools:
106107
107108
```python
108109
from flyteplugins.jira import JiraClient
109110
110111
async with JiraClient() as client:
111-
issue = await client.get_issue("PROJ-123")
112+
issue = await client.get_issue.aio("PROJ-123")
113+
```
114+
115+
Use the blocking one in plain `def` tasks and scripts. It parks the calling
116+
thread until the call returns, so never reach for it on an event loop:
117+
118+
```python
119+
with JiraClient() as client:
120+
issue = client.get_issue("PROJ-123")
112121
```
113122
114123
Args:

0 commit comments

Comments
 (0)