@@ -101,44 +101,22 @@ def test_get_last_prefix_not_bytes(transaction: TimestampedPartitionTransaction)
101
101
assert tx .get_last (timestamp = 10 , prefix = b'"key"' ) == "value"
102
102
103
103
104
- def test_get_last_from_cache_with_retention (
105
- transaction : TimestampedPartitionTransaction ,
106
- ):
107
- with transaction () as tx :
108
- tx .set_for_timestamp (timestamp = 5 , value = "value" , prefix = b"key" )
109
- assert tx .get_last (timestamp = 10 , prefix = b"key" ) == "value"
110
- assert tx .get_last (timestamp = 10 , prefix = b"key" , retention_ms = 5 ) == "value"
111
- assert tx .get_last (timestamp = 10 , prefix = b"key" , retention_ms = 4 ) == None
112
-
113
-
114
- def test_get_last_from_store_with_retention (
115
- transaction : TimestampedPartitionTransaction ,
116
- ):
117
- with transaction () as tx :
118
- tx .set_for_timestamp (timestamp = 5 , value = "value" , prefix = b"key" )
119
-
120
- with transaction () as tx :
121
- assert tx .get_last (timestamp = 10 , prefix = b"key" ) == "value"
122
- assert tx .get_last (timestamp = 10 , prefix = b"key" , retention_ms = 5 ) == "value"
123
- assert tx .get_last (timestamp = 10 , prefix = b"key" , retention_ms = 4 ) == None
124
-
125
-
126
104
def test_get_last_for_out_of_order_timestamp (
127
105
transaction : TimestampedPartitionTransaction ,
128
106
):
129
107
with transaction () as tx :
130
108
tx .set_for_timestamp (
131
109
timestamp = 10 , value = "value10" , prefix = b"key" , retention_ms = 5
132
110
)
133
- assert tx .get_last (timestamp = 10 , prefix = b"key" , retention_ms = 5 ) == "value10"
111
+ assert tx .get_last (timestamp = 10 , prefix = b"key" ) == "value10"
134
112
tx .set_for_timestamp (timestamp = 5 , value = "value5" , prefix = b"key" , retention_ms = 5 )
135
113
tx .set_for_timestamp (timestamp = 4 , value = "value4" , prefix = b"key" , retention_ms = 5 )
136
114
137
115
with transaction () as tx :
138
- assert tx .get_last (timestamp = 5 , prefix = b"key" , retention_ms = 5 ) == "value5"
116
+ assert tx .get_last (timestamp = 5 , prefix = b"key" ) == "value5"
139
117
140
118
# Retention watermark is 10 - 5 = 5 so everything lower is ignored
141
- assert tx .get_last (timestamp = 4 , prefix = b"key" , retention_ms = 5 ) is None
119
+ assert tx .get_last (timestamp = 4 , prefix = b"key" ) is None
142
120
143
121
144
122
def test_set_for_timestamp_with_prefix_not_bytes (
@@ -156,8 +134,8 @@ def test_set_for_timestamp_with_retention_cached(
156
134
with transaction () as tx :
157
135
tx .set_for_timestamp (timestamp = 2 , value = "v2" , prefix = b"key" , retention_ms = 2 )
158
136
tx .set_for_timestamp (timestamp = 5 , value = "v5" , prefix = b"key" , retention_ms = 2 )
159
- assert tx .get_last (timestamp = 2 , prefix = b"key" , retention_ms = 3 ) == None
160
- assert tx .get_last (timestamp = 5 , prefix = b"key" , retention_ms = 3 ) == "v5"
137
+ assert tx .get_last (timestamp = 2 , prefix = b"key" ) == None
138
+ assert tx .get_last (timestamp = 5 , prefix = b"key" ) == "v5"
161
139
162
140
163
141
def test_set_for_timestamp_with_retention_stored (
@@ -168,5 +146,5 @@ def test_set_for_timestamp_with_retention_stored(
168
146
tx .set_for_timestamp (timestamp = 5 , value = "v5" , prefix = b"key" , retention_ms = 2 )
169
147
170
148
with transaction () as tx :
171
- assert tx .get_last (timestamp = 2 , prefix = b"key" , retention_ms = 3 ) == None
172
- assert tx .get_last (timestamp = 5 , prefix = b"key" , retention_ms = 3 ) == "v5"
149
+ assert tx .get_last (timestamp = 2 , prefix = b"key" ) == None
150
+ assert tx .get_last (timestamp = 5 , prefix = b"key" ) == "v5"
0 commit comments