Skip to content

Commit

Permalink
AG-74: All option added for boundary type.
Browse files Browse the repository at this point in the history
  • Loading branch information
MHA10 committed May 9, 2023
1 parent 3cb33f4 commit 4497e78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def fetch_geo_ids_for_cell_tokens(s2_cell_tokens, domain, boundary_type=None):
else:
geo_ids = db.session.query(GeoIds.geo_id).distinct().join(CellsGeosMiddle).join(S2CellTokens).filter(
S2CellTokens.cell_token.in_(set(s2_cell_tokens)))
if boundary_type and not isinstance(geo_ids, list):
if boundary_type and boundary_type != "all" and not isinstance(geo_ids, list):
geo_ids = geo_ids.filter(GeoIds.boundary_type == boundary_type)
geo_ids = [r.geo_id for r in geo_ids]
return geo_ids
Expand Down Expand Up @@ -352,7 +352,7 @@ def fetch_fields_for_a_point_two_way(s2_cell_token_13, s2_cell_token_20, domain,
else:
geo_ids = db.session.query(GeoIds.geo_id).distinct().join(CellsGeosMiddle).join(S2CellTokens).filter(
S2CellTokens.cell_token == s2_cell_token_13)
if boundary_type:
if boundary_type and boundary_type != "all":
geo_ids = geo_ids.filter(GeoIds.boundary_type == boundary_type)
geo_ids = [r.geo_id for r in geo_ids]
fields_to_return = []
Expand Down

0 comments on commit 4497e78

Please sign in to comment.