44
55A ` Builder ` is a class that inherits from ` maggma.core.Builder ` and implement 3 methods:
66
7- * ` get_items ` : This method should return some iterable of items to run through ` process_items `
7+ * ` get_items ` : This method should return some iterable of items to run through ` process_item `
88* ` process_item ` : This method should take a single item, process it, and return the processed item
99* ` update_targets ` : This method should take a list of processed items and update the target stores.
1010
@@ -116,7 +116,7 @@ Our simple process item just has to multiply one field by `self.multiplier`:
116116
117117``` python
118118
119- def process_items (self , item : Dict) -> Dict:
119+ def process_item (self , item : Dict) -> Dict:
120120 """
121121 Multiplies the "a" sub-document by self.multiplier
122122 """
@@ -141,8 +141,8 @@ Finally, we have to put the processed item in to the target store:
141141
142142
143143!!! note
144- Note that whatever ` process_items ` returns, ` update_targets ` takes a ` List ` of these:
145- For instance, if ` process_items ` returns ` str ` , then ` update_targets ` would look like:
144+ Note that whatever ` process_item ` returns, ` update_targets ` takes a ` List ` of these:
145+ For instance, if ` process_item ` returns ` str ` , then ` update_targets ` would look like:
146146 ``` python
147147
148148 def update_target(self,items: List[str]):
@@ -183,7 +183,7 @@ class MultiplyBuilder(Builder):
183183 """
184184 docs = list (self .source.query())
185185
186- def process_items (self , item : Dict) -> Dict:
186+ def process_item (self , item : Dict) -> Dict:
187187 """
188188 Multiplies the "a" sub-document by self.multiplier
189189 """
0 commit comments