Commit 67a044e
committed
feat(grz-db,grz-common): clean up populate API surface
Four related changes to the populate-side public surface:
- Split 'force' from 'on_missing' on SubmissionDb.populate. 'force'
previously double-duty'd as 'allow destructive overwrites' AND
'silently treat a missing submission as fresh-create'. Add explicit
'on_missing: Literal["create", "error"]' defaulting to 'error'
(raises SubmissionNotFoundError, matching grzctl 'db submission
populate'). The download path opts into 'create' explicitly.
- Drop the now-redundant implicit 'force=True' after auto-create.
Verified: 'Diff.classify' produces only NEW states when old_value is
None, so 'has_pending_destructive' is always False for a fresh row.
- Drop the 'log: logging.Logger | None' parameter. Use the module
logger throughout. Idiomatic Python; callers configure via
'logging.getLogger("grz_db.models.submission")'.
- Drop Worker.load_metadata_with_submission_date. It bundled an S3
head_object and a local file read into one tuple-returning method
to keep the download.py call site short, but those are two distinct
concerns. download.py now calls 'get_metadata_upload_timestamp' and
'worker_inst.parse_submission().metadata.content' separately.1 parent 0205cc4 commit 67a044e
4 files changed
Lines changed: 50 additions & 56 deletions
File tree
- packages
- grz-common/src/grz_common/workers
- grz-db/src/grz_db/models/submission
- grzctl/src/grzctl/commands
- tests/cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | | - | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
| |||
313 | 310 | | |
314 | 311 | | |
315 | 312 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
Lines changed: 27 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
1254 | | - | |
1255 | 1254 | | |
1256 | 1255 | | |
1257 | 1256 | | |
1258 | 1257 | | |
1259 | 1258 | | |
1260 | 1259 | | |
1261 | 1260 | | |
1262 | | - | |
| 1261 | + | |
1263 | 1262 | | |
1264 | | - | |
| 1263 | + | |
1265 | 1264 | | |
1266 | 1265 | | |
1267 | | - | |
| 1266 | + | |
1268 | 1267 | | |
1269 | 1268 | | |
1270 | 1269 | | |
1271 | | - | |
| 1270 | + | |
1272 | 1271 | | |
1273 | 1272 | | |
1274 | 1273 | | |
1275 | 1274 | | |
1276 | 1275 | | |
1277 | | - | |
| 1276 | + | |
1278 | 1277 | | |
1279 | 1278 | | |
1280 | 1279 | | |
1281 | 1280 | | |
1282 | 1281 | | |
1283 | | - | |
| 1282 | + | |
1284 | 1283 | | |
1285 | 1284 | | |
1286 | 1285 | | |
| |||
1317 | 1316 | | |
1318 | 1317 | | |
1319 | 1318 | | |
| 1319 | + | |
1320 | 1320 | | |
1321 | | - | |
1322 | 1321 | | |
1323 | 1322 | | |
1324 | 1323 | | |
1325 | | - | |
1326 | | - | |
| 1324 | + | |
1327 | 1325 | | |
1328 | 1326 | | |
1329 | 1327 | | |
1330 | | - | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1331 | 1331 | | |
1332 | 1332 | | |
1333 | 1333 | | |
1334 | 1334 | | |
1335 | | - | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1336 | 1341 | | |
1337 | 1342 | | |
1338 | | - | |
| 1343 | + | |
| 1344 | + | |
1339 | 1345 | | |
1340 | 1346 | | |
1341 | 1347 | | |
1342 | 1348 | | |
1343 | | - | |
1344 | | - | |
1345 | 1349 | | |
1346 | 1350 | | |
1347 | 1351 | | |
1348 | | - | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
1349 | 1355 | | |
1350 | | - | |
1351 | | - | |
| 1356 | + | |
1352 | 1357 | | |
1353 | 1358 | | |
1354 | 1359 | | |
| |||
1367 | 1372 | | |
1368 | 1373 | | |
1369 | 1374 | | |
1370 | | - | |
1371 | | - | |
| 1375 | + | |
| 1376 | + | |
1372 | 1377 | | |
1373 | 1378 | | |
1374 | | - | |
| 1379 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
76 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
77 | 86 | | |
78 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
273 | 277 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
| |||
0 commit comments