feat: add contact imports endpoints#220
Conversation
There was a problem hiding this comment.
5 issues found and verified against the latest diff
Confidence score: 2/5
- In
resend/request.pyandresend/http_client_requests.py, request payload handling is inconsistent: always passing new kwargs can break custom sync HTTP clients, anddatacan be silently dropped whenfilesisNone, risking failed requests and lost form fields in production — gatefiles/datakwargs so they are only sent when present and ensure thedata-only path is preserved before merging. - In
resend/contacts/imports/_contact_import.py, typingcountsasOptional[...]models a nullable value instead of an absent key, which can mislead consumers and cause parsing/validation bugs for queued or in-progress imports — switch toNotRequired[ContactImportCounts]to match actual API shape. - In
resend/contacts/imports/_contact_imports.py, appendingstatustwice creates duplicate query parameters, which can lead to ambiguous backend filtering and hard-to-debug list results — remove the duplicate append so each filter key is emitted once. - In
tests/contact_imports_test.py, exception tests using baretry/exceptcan pass even if errors stop being raised, reducing regression detection for critical validation paths — convert these toassertRaises/pytest.raises(or add explicitfail()in anelse) before merge.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Requires human review: Auto-approval blocked by 5 unresolved issues from previous reviews.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Requires human review: Auto-approval blocked by 5 unresolved issues from previous reviews.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Requires human review: Auto-approval blocked by 5 unresolved issues from previous reviews.
Re-trigger cubic
|
@drish I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
2 issues found across 16 files
Confidence score: 3/5
- In
resend/http_client_requests.py, sending bothdataandjsonrisks the JSON body being silently dropped, which can change API request payloads for callers and cause hard-to-trace behavior regressions; ensure the request builder enforces one body mode (or deterministic precedence) before merging. - In
resend/contacts/imports/_contact_imports.py, duplicated multipart assembly across sync/async paths increases drift risk, so a future fix may land in only one path and create inconsistent import behavior; factor shared payload construction into a common helper to de-risk maintenance.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Requires human review: Adds new API endpoints for contact imports with multipart file uploads, new models, and HTTP client refactoring. These are non-trivial changes to business logic and network request handling that require human review.
Re-trigger cubic
…a in custom http client example
… resend.Contacts.Imports.* access
|
You're iterating quickly on this pull request. To help protect your rate limits, cubic has paused automatic reviews on new pushes for now—when you're ready for another review, comment |
|
@cubic-dev-ai review |
@drish I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
0 issues found across 0 files (changes from recent commits).
Requires human review: Adds new API endpoints for contact imports (CSV upload, get, list) with multipart handling, requiring human review for API design, error handling, and breaking changes to the HTTP client interface.
Re-trigger cubic
Summary by cubic
Adds contact import endpoints to the
resendPython SDK with CSV multipart upload (sync/async) and aresend.Contacts.Imports.*access pattern. Improves multipart handling, addscompleted_at, and bumps version to 2.32.0.New Features
Contacts.Imports.createuploads CSV via multipart withfilename,column_map,on_conflict,segments,topics;getandlistsupport status filtering and pagination. Async:create_async,get_async,list_async.ContactImport(withcompleted_at, optionalcounts) andContactImportCounts. Types use direct class refs for Python 3.7 compatibility.Migration
requestsignature to acceptfiles: Dict[str, Any]anddata: Dict[str, str], and only sendjsonwhen not sendingdata/files. Defaults forrequests/httpxare updated; seeexamples/with_custom_http_client.py.Written for commit 3d31f4d. Summary will update on new commits.