Skip to content

Commit

Permalink
Playing around NoneType checking
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Malchyk <snooki17@gmail.com>
  • Loading branch information
AMProduction committed Oct 11, 2023
1 parent 6d9f6ca commit 0220fa6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geoapi/src/db_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_area_db(region: str) -> float:
group by region;
""")
results = conn.execute(sql)
if results:
if results is not None:
return results.first()[0]


Expand All @@ -30,7 +30,7 @@ def get_gross_yield_db(region: str) -> float:
FROM harvest;
""")
results = conn.execute(sql)
if results:
if results is not None:
return results.first()[0]


Expand All @@ -46,7 +46,7 @@ def get_weighted_average_yield_per_hectare_db(region: str) -> float:
FROM harvest;
""")
results = conn.execute(sql)
if results:
if results is not None:
return results.first()[0]


Expand Down

0 comments on commit 0220fa6

Please sign in to comment.