31
31
)
32
32
33
33
34
- def test_serialize_plan_table_scan_request ():
34
+ def test_serialize_plan_table_scan_request () -> None :
35
35
"""Test serializing a PlanTableScanRequest to a dict"""
36
36
expression = AndOrExpression (
37
37
type = "and" ,
@@ -63,7 +63,7 @@ def test_serialize_plan_table_scan_request():
63
63
assert request .model_dump_json (exclude_none = True ) == snapshot_json_for_plan_table_scan_request ()
64
64
65
65
66
- def test_deserialize_plan_table_scan_request ():
66
+ def test_deserialize_plan_table_scan_request () -> None :
67
67
"""Test deserializing a PlanTableScanRequest from a dict"""
68
68
expression = AndOrExpression (
69
69
type = "and" ,
@@ -95,7 +95,7 @@ def test_deserialize_plan_table_scan_request():
95
95
assert request == PlanTableScanRequest .model_validate_json (snapshot_json_for_plan_table_scan_request ())
96
96
97
97
98
- def test_deserialize_scan_tasks ():
98
+ def test_deserialize_scan_tasks () -> None :
99
99
"""Test deserializing a ScanTasks from a dict"""
100
100
scan_tasks = ScanTasks .model_validate_json (snapshot_json_for_scan_tasks ())
101
101
assert len (scan_tasks .file_scan_tasks ) == 1
@@ -105,7 +105,7 @@ def test_deserialize_scan_tasks():
105
105
assert scan_tasks .delete_files [1 ].root .file_path == "/path/to/delete-b.parquet"
106
106
107
107
108
- def test_serialize_scan_tasks ():
108
+ def test_serialize_scan_tasks () -> None :
109
109
"""Test serializing a ScanTasks to a dict"""
110
110
scan_tasks = ScanTasks (
111
111
file_scan_tasks = [
@@ -151,9 +151,9 @@ def test_serialize_scan_tasks():
151
151
assert scan_tasks .model_dump_json (exclude_none = True ) == snapshot_json_for_scan_tasks ()
152
152
153
153
154
- def snapshot_json_for_plan_table_scan_request ():
154
+ def snapshot_json_for_plan_table_scan_request () -> str :
155
155
return """{"snapshot-id":1,"select":["a","b","c"],"filter":{"type":"and","left":{"type":"or","left":{"type":"and","left":{"type":"lt","term":"a","value":{"type":"integer","value":1}},"right":{"type":"lt-eq","term":"b","value":{"type":"integer","value":2}}},"right":{"type":"eq","term":"c","value":{"type":"integer","value":3}}},"right":{"type":"gt","term":"d","value":{"type":"integer","value":4}}},"case-sensitive":true,"use-snapshot-schema":false}"""
156
156
157
157
158
- def snapshot_json_for_scan_tasks ():
158
+ def snapshot_json_for_scan_tasks () -> str :
159
159
return """{"delete-files":[{"content":"position-deletes","file-path":"/path/to/delete-a.parquet","file-format":"parquet","spec-id":0,"partition":[],"file-size-in-bytes":256,"record-count":10},{"content":"equality-deletes","file-path":"/path/to/delete-b.parquet","file-format":"parquet","spec-id":0,"partition":[],"file-size-in-bytes":256,"record-count":10,"equality-ids":[1,2]}],"file-scan-tasks":[{"data-file":{"content":"data","file-path":"/path/to/data-a.parquet","file-format":"parquet","spec-id":0,"partition":[],"file-size-in-bytes":1024,"record-count":56},"delete-file-references":[0,1]}]}"""
0 commit comments