Skip to content

Commit

Permalink
Fix bug on generating stats endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Dec 14, 2023
1 parent 8204cb0 commit e7e0609
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion API/api_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def process_raw_data(self, params):
)
inside_file_size = 0
polygon_stats = None
if "include_stats" in params:
if "include_stats" in params.dict():
if params.include_stats:
feature = {
"type": "Feature",
Expand Down
1 change: 1 addition & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ def get_summary_stats(self):
or analytics_data["data"]["polygonStatistic"]["analytics"]["functions"]
is None
):
logging.error(analytics_data)
return None
for function in analytics_data["data"]["polygonStatistic"]["analytics"][
"functions"
Expand Down
2 changes: 1 addition & 1 deletion src/validation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def get_value_as_feature(cls, value):
"""Converts geometry to geojson feature"""
feature = {
"type": "Feature",
"geometry": (value.json()),
"geometry": json.loads(value.json()),
"properties": {},
}
return feature

0 comments on commit e7e0609

Please sign in to comment.