Commit 841488b
committed
refactor(serverless): address PR review feedback for boto3 lazy-loading
Address Copilot review comments from PR #466:
1. Extract boto3 import logic into shared helper function
- Created _import_boto3_dependencies() to reduce duplication
- Used by both get_boto_client() and bucket_upload()
- Consistent error handling across all S3 upload functions
2. Add TransferConfig import to bucket_upload()
- Now imports all boto3 dependencies via shared helper
- Maintains consistency with get_boto_client()
3. Clarify documentation about fallback directories
- Documented that upload_image() uses simulated_uploaded/
- Documented that public API functions use local_upload/
- Added context about when fallback behavior occurs
All 358 tests pass with 97% coverage.1 parent 73dc607 commit 841488b
2 files changed
Lines changed: 23 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
23 | 40 | | |
24 | 41 | | |
25 | 42 | | |
| |||
45 | 62 | | |
46 | 63 | | |
47 | 64 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 65 | + | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
| |||
187 | 202 | | |
188 | 203 | | |
189 | 204 | | |
190 | | - | |
191 | | - | |
| 205 | + | |
192 | 206 | | |
193 | 207 | | |
194 | 208 | | |
195 | 209 | | |
196 | 210 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 211 | + | |
200 | 212 | | |
201 | 213 | | |
202 | 214 | | |
| |||
0 commit comments