Skip to content

Commit

Permalink
Update disk storage executor to use all the attributes from StoragePlan
Browse files Browse the repository at this point in the history
Former-commit-id: ae1af4f
  • Loading branch information
saiprashanth173 committed Nov 23, 2019
1 parent d2ba3db commit 7c5e05e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/query_executor/disk_based_storage_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ class DiskStorageExecutor(AbstractStorageExecutor):

def __init__(self, node: StoragePlan):
super().__init__(node)
self.storage = SimpleVideoLoader(node.video)
self.storage = SimpleVideoLoader(node.video,
batch_size=node.batch_size,
skip_frames=node.skip_frames,
limit=node.limit,
offset=node.offset)

def validate(self):
pass
Expand Down
7 changes: 6 additions & 1 deletion test/query_executor/test_disk_storage_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ def test_calling_storage_executor_should_return_batches(self, mock_class):
class_instance.load.return_value = range(5)
actual = list(executor.next())

mock_class.assert_called_once_with(video_info)
mock_class.assert_called_once_with(video_info,
batch_size=storage_plan.batch_size,
limit=storage_plan.limit,
offset=storage_plan.offset,
skip_frames=storage_plan.skip_frames,
)
class_instance.load.assert_called_once()
self.assertEqual(list(range(5)), actual)

0 comments on commit 7c5e05e

Please sign in to comment.