Conversation
|
wow, I loved this Async support!!! great job @drish |
|
@bukinoshita @felipevolpone Is there any update on this? Are there any outstanding tasks that any of us could potentially help with to get this PR unblocked and merged? |
@ojh i had to re-prioritize some work and this ended up having to wait a bit. I'll be working on this back again this coming week, should be very close to wrap up. |
|
nice! i was thinking about this and now i am happy because this pull request. thanks |
There was a problem hiding this comment.
10 issues found across 23 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="resend/contacts/_contacts.py">
<violation number="1" location="resend/contacts/_contacts.py:379">
P2: Custom agent: **API Key Permission Check SDK Methods**
New async contact paths now call the global /contacts endpoints. Please confirm that production API keys have the required permissions for global contact operations to avoid permission-related failures after deployment (API Key Permission Check SDK Methods rule).</violation>
</file>
<file name="resend/emails/_attachments.py">
<violation number="1" location="resend/emails/_attachments.py:133">
P2: AsyncRequest can be undefined when async extras aren’t installed, causing a NameError on get_async. Import it inside the method (or raise a clear ImportError) to fail fast with a clear message.</violation>
</file>
<file name="tests/contacts_segments_async_test.py">
<violation number="1" location="tests/contacts_segments_async_test.py:8">
P2: Async test methods on a `unittest.TestCase` base are not awaited, so these tests won’t run and will report false positives. Use `IsolatedAsyncioTestCase` (or a pytest async marker) for async tests.</violation>
</file>
<file name="tests/contact_properties_async_test.py">
<violation number="1" location="tests/contact_properties_async_test.py:8">
P2: These async tests inherit from `unittest.TestCase` via `ResendBaseTest`, so the `async def` test methods are never awaited by the unittest runner. The assertions inside the new tests won’t execute. Use an async-capable base like `unittest.IsolatedAsyncioTestCase` or convert these to pytest-style async tests.</violation>
</file>
<file name="resend/webhooks/_webhooks.py">
<violation number="1" location="resend/webhooks/_webhooks.py:370">
P2: Async methods call `AsyncRequest` even when the optional async dependency isn’t installed, which will raise `NameError` at runtime. Add an explicit guard (and/or define `AsyncRequest = None` on import failure) to raise a clear ImportError before trying to use it.</violation>
</file>
<file name="tests/templates_async_test.py">
<violation number="1" location="tests/templates_async_test.py:8">
P2: Async test methods are defined on a `unittest.TestCase` subclass, which doesn’t await async tests. These tests will be skipped or treated as coroutines rather than executed. Use an async-aware base class (e.g., `unittest.IsolatedAsyncioTestCase`) or mark the tests for an async test runner (e.g., pytest with `@pytest.mark.asyncio`) and adjust the base class accordingly.</violation>
</file>
<file name="resend/contact_properties/_contact_properties.py">
<violation number="1" location="resend/contact_properties/_contact_properties.py:284">
P2: Guard async methods against missing `resend[async]` so callers get a clear ImportError instead of a NameError when AsyncRequest isn’t available.</violation>
</file>
<file name="resend/contacts/_topics.py">
<violation number="1" location="resend/contacts/_topics.py:217">
P2: AsyncRequest is optional but the ImportError is swallowed, leaving AsyncRequest undefined. Calling list_async/update_async without the async extra will raise a NameError instead of a clear ImportError. Add an explicit guard or error when the async dependency is missing.</violation>
</file>
<file name="resend/topics/_topics.py">
<violation number="1" location="resend/topics/_topics.py:251">
P2: `AsyncRequest` is silently ignored on ImportError, so calling any `*_async` method without the async extra raises `NameError` instead of a clear dependency error. Add a guard or explicit ImportError for missing async extras.</violation>
</file>
<file name="tests/webhooks_async_test.py">
<violation number="1" location="tests/webhooks_async_test.py:8">
P2: Async tests in a unittest.TestCase subclass won’t be awaited, so these new async tests won’t actually run (they’ll return coroutine objects and be treated as passing). Use an async-capable base (e.g., IsolatedAsyncioTestCase) or pytest-asyncio markers instead.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Introduces async support using the httpx library.
SDK async version
Users will need to install the async version of the sdk (extra-requries) with:
pip install resend[async]Set the default_http_client:
_async):