Skip to content

Commit

Permalink
Simplify code for record creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tijmenbaarda committed Dec 23, 2024
1 parent ede0473 commit d34f9a4
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions edpop_explorer/cerl.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,7 @@ def _perform_query(self, start_record: int, maximum_records: Optional[int]) -> L
except KeyError:
raise ReaderError('Number of hits not given in server response')

if 'rows' not in response:
# There are no rows in the response, so stop here
return []

records: List[Record] = []
for rawrecord in response['rows']:
record = self._convert_record(rawrecord)
records.append(record)

return records
return [self._convert_record(x) for x in response['rows']] if 'rows' in response else []

@classmethod
def transform_query(cls, query) -> str:
Expand Down

0 comments on commit d34f9a4

Please sign in to comment.