Skip to content

Commit f1e5ab3

Browse files
authored
Remove unused ResultSet class. (#859)
1 parent 87f9315 commit f1e5ab3

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

pynamodb/models.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,6 @@ class DefaultMeta(object):
161161
pass
162162

163163

164-
# TODO(garrettheel): is this used anywhere?
165-
class ResultSet(Iterable):
166-
167-
def __init__(self, results, operation, arguments):
168-
self.results = results
169-
self.operation = operation
170-
self.arguments = arguments
171-
172-
def __iter__(self):
173-
return iter(self.results)
174-
175-
176164
class MetaModel(AttributeContainerMeta):
177165
table_name: str
178166
read_capacity_units: Optional[int]

tests/test_model.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
RESPONSES, KEYS, ITEMS, LAST_EVALUATED_KEY, EXCLUSIVE_START_KEY, ATTRIBUTES, BINARY,
2323
UNPROCESSED_ITEMS, DEFAULT_ENCODING, MAP, LIST, NUMBER, SCANNED_COUNT,
2424
)
25-
from pynamodb.models import Model, ResultSet
25+
from pynamodb.models import Model
2626
from pynamodb.indexes import (
2727
GlobalSecondaryIndex, LocalSecondaryIndex, AllProjection,
2828
IncludeProjection, KeysOnlyProjection, Index
@@ -2785,23 +2785,6 @@ def test_deserializing_map_four_layers_deep_works(self):
27852785
item = TreeModel.get('123')
27862786
self.assertEqual(item.left.left.left.value, 3)
27872787

2788-
def test_result_set_init(self):
2789-
results = []
2790-
operations = 1
2791-
arguments = 'args'
2792-
rs = ResultSet(results=results, operation=operations, arguments=arguments)
2793-
self.assertEqual(rs.results, results)
2794-
self.assertEqual(rs.operation, operations)
2795-
self.assertEqual(rs.arguments, arguments)
2796-
2797-
def test_result_set_iter(self):
2798-
results = [1, 2, 3]
2799-
operations = 1
2800-
arguments = 'args'
2801-
rs = ResultSet(results=results, operation=operations, arguments=arguments)
2802-
for k in rs:
2803-
self.assertTrue(k in results)
2804-
28052788
def test_explicit_raw_map_serialize_pass(self):
28062789
map_native = {'foo': 'bar'}
28072790
map_serialized = {'M': {'foo': {'S': 'bar'}}}

0 commit comments

Comments
 (0)