Commit fc4fedf
committed
Collapse duplicate replace_table_transaction onto Catalog
Before: replace_table_transaction was @AbstractMethod on Catalog, with
identical 9-line bodies on MetastoreCatalog and RestCatalog (only REST
added @Retry). The bodies were identical because the only thing that
could vary - the load_table to fetch existing metadata - already lives
inside the shared _replace_staged_table helper.
This is unlike create_table_transaction, which legitimately needs
per-catalog impls (REST uses a server-side stage_create=True endpoint,
Metastore stages locally). Replace has no analogous server-side staging,
so the abstract-and-duplicate structure earned no symmetry.
After: Catalog.replace_table_transaction is concrete and owns the
helper-and-construct flow. RestCatalog keeps a thin @retry-only
override that delegates to super(). MetastoreCatalog drops its
override entirely. NoopCatalog keeps its explicit NotImplementedError
stub for consistency with its other every-method-explicit stubs.
Net -22 LOC, one less abstract surface to keep in sync.1 parent e93f019 commit fc4fedf
2 files changed
Lines changed: 12 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | | - | |
453 | 452 | | |
454 | 453 | | |
455 | 454 | | |
| |||
481 | 480 | | |
482 | 481 | | |
483 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
484 | 494 | | |
485 | 495 | | |
486 | 496 | | |
| |||
1030 | 1040 | | |
1031 | 1041 | | |
1032 | 1042 | | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | 1043 | | |
1056 | 1044 | | |
1057 | 1045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
| 972 | + | |
983 | 973 | | |
984 | 974 | | |
985 | 975 | | |
| |||
0 commit comments