The following SQLite query returns 3:
SELECT MAX(depth) FROM mpitree WHERE child = 2
But this code evaluates to None:
def ancestors_depth(self):
self.cursor.execute("SELECT MAX(depth) FROM mpitree WHERE child = 2");
return self.cursor.fetchone()[0]
Why is that ?