Skip to content
Snippets Groups Projects
Commit 4b223018 authored by Tobias Schmidt's avatar Tobias Schmidt
Browse files

table class: check for empty table in MaxRow/MinRow

parent 21ff2b81
Branches
Tags
No related merge requests found
...@@ -1363,9 +1363,12 @@ Statistics for column %(col)s ...@@ -1363,9 +1363,12 @@ Statistics for column %(col)s
:param col: column name :param col: column name
:type col: :class:`str` :type col: :class:`str`
:returns: row with maximal col value or None if the table is empty
""" """
val, idx = self._Max(col) val, idx = self._Max(col)
return self.rows[idx] if idx!=None:
return self.rows[idx]
def Max(self, col): def Max(self, col):
""" """
...@@ -1427,9 +1430,12 @@ Statistics for column %(col)s ...@@ -1427,9 +1430,12 @@ Statistics for column %(col)s
:param col: column name :param col: column name
:type col: :class:`str` :type col: :class:`str`
:returns: row with minimal col value or None if the table is empty
""" """
val, idx = self._Min(col) val, idx = self._Min(col)
return self.rows[idx] if idx!=None:
return self.rows[idx]
def MinIdx(self, col): def MinIdx(self, col):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment