Commit 9dd3215
authored
Yuanjieding/experimental files ext (#1009)
## What changes are proposed in this pull request?
**WHAT**
- This PR fixes the issue that the old retry mechanism failed to
identify the retriable errors.
- It has done that by providing a new mechanism to support
distinguishing retriable and non-retriable errors solely by its status
code, which is the expected behavior when calling
_retry_cloud_idempotent_operation.
- The old _retry_idempotent_operation is removed because it is out of
use and can be misleading.
- The PR also refactors the `test_files`, which are the unit tests for
the `FilesExt` class.
- Added typing for all methods and argument lists
- Introduced `UploadTestCase` as the base class for upload test cases,
in order to reduce the code duplication
- Renamed all `chunk` to `part`, to align the terminology with the HTTP
API.
**WHY**
- The previous implementation utilizes error mappers that's designed for
calling Databricks APIs (aka internal APIs), which the retry functions
relies on to determine whether the requests is retriable or not.
However, when calling the uploading API, it could be calling a CSP API
(aka external API), which we wish to distinguish whether it is retriable
solely on it's status code.
- Refactor of unit test file is done to improve its readability and
maintainability.
## How is this tested?
Unit tests.
**ALWAYS ANSWER THIS QUESTION:** Answer with "N/A" if tests are not
applicable
to your PR (e.g. if the PR only modifies comments). Do not be afraid of
answering "Not tested" if the PR has not been tested. Being clear about
what
has been done and not done provides important context to the reviewers.1 parent 9548a18 commit 9dd3215
File tree
3 files changed
+660
-650
lines changed- databricks/sdk/mixins
- tests
3 files changed
+660
-650
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
577 | 576 | | |
578 | 577 | | |
579 | 578 | | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
580 | 600 | | |
581 | 601 | | |
582 | 602 | | |
| |||
885 | 905 | | |
886 | 906 | | |
887 | 907 | | |
888 | | - | |
| 908 | + | |
889 | 909 | | |
890 | 910 | | |
891 | 911 | | |
| |||
1097 | 1117 | | |
1098 | 1118 | | |
1099 | 1119 | | |
1100 | | - | |
| 1120 | + | |
1101 | 1121 | | |
1102 | 1122 | | |
1103 | 1123 | | |
| |||
1116 | 1136 | | |
1117 | 1137 | | |
1118 | 1138 | | |
1119 | | - | |
| 1139 | + | |
1120 | 1140 | | |
1121 | 1141 | | |
1122 | 1142 | | |
| |||
1243 | 1263 | | |
1244 | 1264 | | |
1245 | 1265 | | |
1246 | | - | |
| 1266 | + | |
1247 | 1267 | | |
1248 | 1268 | | |
1249 | 1269 | | |
| |||
1265 | 1285 | | |
1266 | 1286 | | |
1267 | 1287 | | |
1268 | | - | |
| 1288 | + | |
1269 | 1289 | | |
1270 | 1290 | | |
1271 | 1291 | | |
| |||
1283 | 1303 | | |
1284 | 1304 | | |
1285 | 1305 | | |
1286 | | - | |
| 1306 | + | |
1287 | 1307 | | |
1288 | 1308 | | |
1289 | | - | |
1290 | | - | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1291 | 1312 | | |
1292 | 1313 | | |
1293 | | - | |
| 1314 | + | |
1294 | 1315 | | |
1295 | 1316 | | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
| 1317 | + | |
1300 | 1318 | | |
1301 | 1319 | | |
1302 | 1320 | | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1303 | 1331 | | |
1304 | 1332 | | |
1305 | 1333 | | |
1306 | 1334 | | |
1307 | 1335 | | |
1308 | 1336 | | |
1309 | 1337 | | |
1310 | | - | |
| 1338 | + | |
1311 | 1339 | | |
1312 | 1340 | | |
1313 | 1341 | | |
| |||
0 commit comments