Skip to content

Commit

Permalink
Adds todo and fixes comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmechali committed Jan 3, 2025
1 parent 6984b67 commit c73730a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions server/routes/dev_place/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def related_places(place_dcid: str):
seen_dcids = set(
) # Keep track of seen DCIDs to prevent dupes but keep ordering.

# TODO(gmechali): Refactor this into async calls.
for child_place_type in ordered_child_place_types:
for dcid in place_utils.fetch_child_place_dcids(place,
child_place_type,
Expand Down
6 changes: 3 additions & 3 deletions server/routes/dev_place/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,16 @@ def chart_config_to_overview_charts(chart_config, child_place_type: str):

def get_child_place_types(place: Place) -> list[str]:
"""
Determines the primary child place type for a given place.
Determines the child place types for a given place.
This function uses custom matching rules and fallback hierarchies to decide
the most relevant child place type for a given place.
the ordered child place types for a given place.
Args:
place (Place): The place object to analyze.
Returns:
str | None: The primary child place type for the given place, or None if no match is found.
list[str]: The child place types for the given place, or empty list if no match is found.
"""
# Attempt to directly match a child place type using the custom expressions.
for f in PLACE_MATCH_EXPRESSIONS:
Expand Down

0 comments on commit c73730a

Please sign in to comment.