Commit fa9094b
Allow snapshot-id in assert-ref-snapshot-id requirement to serialize to null in json (#2343)
Closes #2342
# Rationale for this change
The OpenAPI spec specifies that `snapshot-id` is required [1], even if
it's `null`. The current code omits the field b/c `exclude_none=True` is
set for all models that extend `IcebergBaseModel`. Setting
`exclude=False` on the field doesn't override the behavior and thus the
model needs to control it's own serialization. This is the only model I
know of so far that has this "required null" problem so I held back from
making another class for this model to extend.
# Are these changes tested?
Yes
# Are there any user-facing changes?
Set `snapshot-id: null` when committing tables that don't have a current
snapshot-id.
[1]:
https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml#L3138-L3155
---------
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Kevin Liu <kevinjqliu@users.noreply.github.com>1 parent f805488 commit fa9094b
2 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
748 | 755 | | |
749 | 756 | | |
750 | 757 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1039 | 1039 | | |
1040 | 1040 | | |
1041 | 1041 | | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1042 | 1045 | | |
1043 | 1046 | | |
1044 | 1047 | | |
| |||
0 commit comments