Skip to content

Commit

Permalink
yield data
Browse files Browse the repository at this point in the history
  • Loading branch information
jal347 committed Oct 3, 2024
1 parent c3df992 commit 8d8e568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/hub/dataload/sources/chembl/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ def load_data(target_filepaths):
with open(file) as f:
content = f.read()
json_data = json.loads(content)
parsed_data = parse_data(json_data)
return parsed_data
for data in parse_data(json_data):
yield data
4 changes: 3 additions & 1 deletion src/hub/dataload/sources/chembl/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def load_data(self, data_folder):
target_filepaths = glob.iglob(
os.path.join(data_folder, self.TARGET_FILENAME_PATTERN)
)
return self.keylookup(load_data(target_filepaths))
for doc in load_data(target_filepaths):
yield doc
# return self.keylookup(load_data(target_filepaths))

@classmethod
def get_mapping(klass):
Expand Down

0 comments on commit 8d8e568

Please sign in to comment.