From 4f607292a64dc2b0989ade0a27dded1b6e69774f Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Feb 2026 22:16:47 +0530 Subject: [PATCH 01/23] Migrate PlaceInfo to V2 API and add verification tests --- server/services/datacommons.py | 239 +++++++++++++++- server/tests/migration_verification_test.py | 292 ++++++++++++++++++++ server/tests/verify_live_migration.py | 101 +++++++ 3 files changed, 621 insertions(+), 11 deletions(-) create mode 100644 server/tests/migration_verification_test.py create mode 100644 server/tests/verify_live_migration.py diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 0a2bd4e6f5..818b4313f6 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -370,10 +370,6 @@ def v2event(node, prop): return post(url, {"node": node, "property": prop}) -def get_place_info(dcids: List[str]) -> Dict: - """Retrieves Place Info given a list of DCIDs.""" - url = get_service_url("/v1/bulk/info/place") - return post(f"{url}", {"nodes": sorted(set(dcids))}) def get_variable_group_info(nodes: List[str], @@ -403,16 +399,237 @@ def get_variable_ancestors(dcid: str): return get(url).get("ancestors", []) +PLACE_TYPE_RANK = { + "CensusZipCodeTabulationArea": 1, + "AdministrativeArea5": 2, "AdministrativeArea4": 2, + "Village": 5, "City": 5, "Town": 5, "Borough": 5, "AdministrativeArea3": 5, + "County": 10, "AdministrativeArea2": 10, "EurostatNUTS3": 10, + "CensusDivision": 15, + "State": 20, "AdministrativeArea1": 20, "EurostatNUTS2": 20, "EurostatNUTS1": 20, + "Country": 30, + "CensusRegion": 35, "GeoRegion": 38, + "Continent": 40, + "Place": 50, +} + + +def get_place_info(dcids: List[str]) -> Dict: + """Retrieves Place Info given a list of DCIDs.""" + # Step 1: Get ancestors manually since v2/node doesn't support ->containedInPlace+ + ancestors_map = {dcid: set() for dcid in dcids} + + parent_graph = {} # child_dcid -> list of parent_dcids + frontier = set(dcids) + visited = set() + + # BFS to build parent graph (max depth 10) + for _ in range(10): + if not frontier: + break + + # Filter out already visited nodes to avoid cycles/redundant fetches + fetch_dcids = [d for d in frontier if d not in visited] + if not fetch_dcids: + break + + # Fetch parents for current frontier + resp = v2node(fetch_dcids, '->containedInPlace') + data = resp.get('data', {}) + + current_frontier = set() + for dcid in fetch_dcids: + visited.add(dcid) + node_data = data.get(dcid, {}) + # Parse arcs: {'nodes': [...]} + arcs_obj = node_data.get('arcs', {}).get('containedInPlace', {}) + nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] + + parents = [x['dcid'] for x in nodes_list if 'dcid' in x] + if parents: + parent_graph[dcid] = parents + current_frontier.update(parents) + + frontier = current_frontier + + # Step 2: Build ancestors list for each requested DCID using the graph + for dcid in dcids: + queue = [dcid] + seen = {dcid} + while queue: + curr = queue.pop(0) + parents = parent_graph.get(curr, []) + for p in parents: + if p not in seen: + seen.add(p) + # Add to ancestors if it's not the node itself (though p != dcid is implied by hierarchy usually) + if p != dcid: + ancestors_map[dcid].add(p) + queue.append(p) + + all_dcids = set() + for anc_set in ancestors_map.values(): + all_dcids.update(anc_set) + all_dcids.update(dcids) + + all_dcids_list = sorted(list(all_dcids)) + if not all_dcids_list: + return {'data': []} + + types_resp = v2node(all_dcids_list, '->typeOf') + names_resp = v2node(all_dcids_list, '->name') + + def get_first_value(resp, dcid, prop, key='dcid'): + node_data = resp.get('data', {}).get(dcid, {}) + # Prop might be returned with or without arrow depending on API, + # but usually matches requested property key + # arcs is a dict: { prop: { 'nodes': [...] } } + arcs_obj = node_data.get('arcs', {}).get(prop, {}) + if not arcs_obj: + # Try checking without arrow if key mismatch + arcs_obj = node_data.get('arcs', {}).get(prop.replace('->', ''), {}) + + nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] + + if nodes_list: + return nodes_list[0].get(key, '') + return '' + + result_data = [] + for dcid in dcids: + self_type = get_first_value(types_resp, dcid, 'typeOf') + self_name = get_first_value(names_resp, dcid, 'name', 'value') + + parents = [] + for anc_dcid in ancestors_map.get(dcid, []): + if anc_dcid == dcid: continue + + anc_type = get_first_value(types_resp, anc_dcid, 'typeOf') + anc_name = get_first_value(names_resp, anc_dcid, 'name', 'value') + + if anc_type in PLACE_TYPE_RANK: + parents.append({ + 'dcid': anc_dcid, + 'type': anc_type, + 'name': anc_name, + 'rank': PLACE_TYPE_RANK[anc_type] + }) + + parents.sort(key=lambda x: x['rank']) + for p in parents: + del p['rank'] + + result_data.append({ + 'node': dcid, + 'info': { + 'self': {'dcid': dcid, 'type': self_type, 'name': self_name}, + 'parents': parents + } + }) + + return {'data': result_data} + + def get_series_dates(parent_entity, child_type, variables): """Get series dates.""" - url = get_service_url("/v1/bulk/observation-dates/linked") - return post( - url, { - "linked_property": "containedInPlace", - "linked_entity": parent_entity, - "entity_type": child_type, - "variables": variables, + # Step 1: Get children + # Note: This checks for DIRECT children (containedInPlace). + children_resp = v2node([parent_entity], '<-containedInPlace') + child_dcids = [] + + node_data = children_resp.get('data', {}).get(parent_entity, {}) + arcs = node_data.get('arcs', {}).get('containedInPlace', []) + possible_children = [x['dcid'] for x in arcs if 'dcid' in x] + + # Filter by type if there are children + if possible_children: + # We need to verify which of these are of child_type + # Optimization: If child_type is generic or we trust, we might skip. + # But V1 likely filtered. + type_resp = v2node(possible_children, 'typeOf') + for child in possible_children: + # Check if child has the requested type + # A node can have multiple types. + c_data = type_resp.get('data', {}).get(child, {}) + c_types = c_data.get('arcs', {}).get('typeOf', []) + c_type_ids = [t.get('dcid') for t in c_types] + if child_type in c_type_ids: + child_dcids.append(child) + + if not child_dcids: + return {"datesByVariable": [], "facets": {}} + + # Step 2: Get observation dates + # We use v2observation to get data for these children + # Query for just date and value? V1 returns counts mostly? + # V1 returns: datesByVariable -> [{variable, observationDates: [{date, entityCount: [{count, facet}]}]}] + # To replicate this, we need all observations for these variable/entity pairs. + + obs_resp = v2observation( + select=['date', 'variable', 'entity', 'value', 'facet'], + entity={'dcids': child_dcids}, + variable={'dcids': variables} + ) + + # Aggregate results + # Structure: { variable: { date: { facet: count } } } + import collections + agg_data = collections.defaultdict(lambda: collections.defaultdict(lambda: collections.defaultdict(int))) + + # Iterate through the response + # V2 response: { byVariable: { var: { byEntity: { ent: { series: [{date, value, facet or facetId}] } } } } } + # Note: if we passed 'select', the structure might be different? + # v2observation helper uses 'select' but returns the byVariable structure usually? + # Let's check v2observation implementation. It calls post("/v2/observation"). + # The response IS usually byVariable. + + by_var = obs_resp.get('byVariable', {}) + unique_facets = {} # facetId -> facetObj + + all_facets = obs_resp.get('facets', {}) + + for var, var_data in by_var.items(): + by_ent = var_data.get('byEntity', {}) + for ent, ent_data in by_ent.items(): + # ent_data contains 'series' usually + series = ent_data.get('series', []) + for obs in series: + date = obs.get('date') + if not date: continue + + # Facet handling + facet_id = obs.get('facet', "") + agg_data[var][date][facet_id] += 1 + # Assuming facets details are in 'facets' key of response? + # v2observation response should have 'facets' top level key if requested? + # 'facet' in select might return the ID in the series or the object? + # Usually it returns facetID and a top-level facets map. + + # Construct response + resp_dates = [] + for var, dates_map in agg_data.items(): + obs_dates = [] + for date, facet_counts in dates_map.items(): + entity_counts = [] + for facet_id, count in facet_counts.items(): + entity_counts.append({ + "count": count, + "facet": facet_id # V1 expects facet ID or object? + # V1 proto: EntityCount { count, facet } where facet is string (ID?). + # But typically it might expect the full facet object in a separate map. + }) + obs_dates.append({ + "date": date, + "entityCount": entity_counts + }) + resp_dates.append({ + "variable": var, + "observationDates": obs_dates }) + + return { + "datesByVariable": resp_dates, + "facets": all_facets + } def resolve(nodes, prop): diff --git a/server/tests/migration_verification_test.py b/server/tests/migration_verification_test.py new file mode 100644 index 0000000000..dd6cf55124 --- /dev/null +++ b/server/tests/migration_verification_test.py @@ -0,0 +1,292 @@ + +import unittest +from unittest.mock import patch +from server.services import datacommons as dc +import json + +class TestMigrationVerification(unittest.TestCase): + + @patch('server.services.datacommons.post') + def test_get_place_info_v2(self, mock_post): + # Setup + dcids = ["geoId/06"] + + # Mock V2 responses + # We expect 3 calls (ancestors, types, names) or 1 call if we optimize, but Plan says 3. + # Actually, Plan says: + # 1. v2node(dcids, '->containedInPlace+') -> ancestors + # 2. v2node(ancestor_dcids, 'typeOf') -> types + # 3. v2node(ancestor_dcids, 'name') -> names + + # Let's mock side_effect to handle these calls + def side_effect(url, data, api_key=None, log_extreme_calls=False): + prop = data.get("property", "") + + # Ancestors call (BFS uses ->containedInPlace) + if "->containedInPlace" in prop: + # Mock returning USA as parent of California + # And nothing for USA (top level for this test) + resp_data = {} + nodes = data.get("nodes", []) + for node in nodes: + if node == "geoId/06": + resp_data[node] = { + "arcs": { + "containedInPlace": { + "nodes": [{"dcid": "country/USA"}] + } + } + } + # no parent for country/USA result in empty dict or just no entry + return {"data": resp_data} + + # key property call (types or name) + if "nodes" in data and len(data["nodes"]) > 0: + nodes = data["nodes"] + if "typeOf" in prop: + return { + "data": { + "country/USA": {"arcs": {"typeOf": {"nodes": [{"dcid": "Country"}]}}}, + "geoId/06": {"arcs": {"typeOf": {"nodes": [{"dcid": "State"}]}}} + } + } + if "name" in prop: + return { + "data": { + "country/USA": {"arcs": {"name": {"nodes": [{"value": "United States"}]}}}, + "geoId/06": {"arcs": {"name": {"nodes": [{"value": "California"}]}}} + } + } + return {} + + mock_post.side_effect = side_effect + + # Execute + # Note: This will fail until we migrate the code + result = dc.get_place_info(dcids) + + # Verify + # Expected V1 structure + expected_parents = [ + {"dcid": "country/USA", "type": "Country", "name": "United States"} + ] + + self.assertIn("data", result) + self.assertEqual(len(result["data"]), 1) + item = result["data"][0] + self.assertEqual(item["node"], "geoId/06") + self.assertIn("info", item) + self.assertEqual(item["info"]["self"]["dcid"], "geoId/06") + self.assertEqual(item["info"]["self"]["type"], "State") + self.assertEqual(item["info"]["self"]["name"], "California") + + # Verify parents are sorted (Country should be last if sorted by rank? Or first?) + # V1 usually returns specific order. + # Our plan says sort by rank. + # State (20) < Country (30). + # We want topological order. + # The user's request: "parents for sorting parents (City -> State -> Country)" + # So "City" (5) comes before "State" (20). + # So parents list should be sorted by rank? + # Actually V1 `parents` list usually goes from immediate parent up to root. + # So State's parent is Country. + # So `parents` should be `[Country]`. + # If we had City, it would be `[County, State, Country]`. + self.assertEqual(item["info"]["parents"], expected_parents) + + @patch('server.services.datacommons.post') + def test_get_series_dates_v2(self, mock_post): + # Setup + parent_entity = "geoId/06" + child_type = "County" + variables = ["Count_Person"] + + def side_effect(url, data, api_key=None, log_extreme_calls=False): + # Step 1: Child nodes + if "<-containedInPlace" in data.get("property", ""): + return { + "data": { + "geoId/06": { + "arcs": { + "containedInPlace": [ + {"dcid": "geoId/06001", "name": "Alameda County", "types": ["County"]}, + {"dcid": "geoId/06085", "name": "Santa Clara County", "types": ["County"]} + ] + } + } + } + } + # Step 1.5: Child types + if "typeOf" in data.get("property", ""): + return { + "data": { + "geoId/06001": {"arcs": {"typeOf": [{"dcid": "County"}]}}, + "geoId/06085": {"arcs": {"typeOf": [{"dcid": "County"}]}} + } + } + # Step 2: Observations + if "variable" in data and "entity" in data: + return { + "byVariable": { + "Count_Person": { + "byEntity": { + "geoId/06001": { + "series": [ + {"date": "2020", "value": 100} + ] + }, + "geoId/06085": { + "series": [ + {"date": "2020", "value": 200}, + {"date": "2021", "value": 210} + ] + } + } + } + } + } + return {} + + mock_post.side_effect = side_effect + + # Execute + result = dc.get_series_dates(parent_entity, child_type, variables) + + # Verify + # Expected V1 structure: + # { + # "datesByVariable": [ + # { + # "variable": "Count_Person", + # "observationDates": [ + # { "date": "2020", "entityCount": [{ "count": 2, "facet": "" }] }, + # { "date": "2021", "entityCount": [{ "count": 1, "facet": "" }] } + # ] + # } + # ] + # } + self.assertIn("datesByVariable", result) + self.assertEqual(len(result["datesByVariable"]), 1) + var_data = result["datesByVariable"][0] + self.assertEqual(var_data["variable"], "Count_Person") + + dates = {d["date"]: d for d in var_data["observationDates"]} + self.assertIn("2020", dates) + self.assertEqual(dates["2020"]["entityCount"][0]["count"], 2) + + self.assertIn("2021", dates) + self.assertEqual(dates["2021"]["entityCount"][0]["count"], 1) + + @patch('server.services.datacommons.post') + def test_get_place_info_edge_cases(self, mock_post): + """Test recursion limits, cycles, and missing data for get_place_info.""" + + # Scenario 1: Max Recursion Depth (Chain > 10 levels) + # Chain: node0 -> node1 -> ... -> node15 + # We expect it to stop at level 10. + def recursion_side_effect(url, data, api_key=None, log_extreme_calls=False): + if "->containedInPlace" in data.get("property", ""): + # Expect 'nodes' in payload + nodes = data.get("nodes", []) + resp_data = {} + for node in nodes: + if node.startswith("node"): + try: + idx = int(node[4:]) + if idx < 15: # Create chain up to 15 + parent = f"node{idx+1}" + resp_data[node] = { + "arcs": { + # Use correct V2 structure: dict with 'nodes' key + "containedInPlace": { + "nodes": [{"dcid": parent}] + } + } + } + except ValueError: + pass + return {"data": resp_data} + + # For types/names, return dummy data + if "nodes" in data: + resp_data = {} + for node in data["nodes"]: + resp_data[node] = { + "arcs": { + "typeOf": {"nodes": [{"dcid": "Place"}]}, + "name": {"nodes": [{"value": f"Name {node}"}]} + } + } + return {"data": resp_data} + return {} + + mock_post.side_effect = recursion_side_effect + + # Test max depth + dcids = ["node0"] + result = dc.get_place_info(dcids) + + self.assertIn("data", result) + item = result["data"][0] + # We expect parents to contain node1..node10 (10 levels) + # logic: loop runs 10 times. + # it finds parents. + # Max ancestors should be limited. + # Actually logic is: for _ in range(10). + # So it fetches 10 levels of parents. + # Ancestors will include node1 to node10. + self.assertEqual(len(item["info"]["parents"]), 10) + parent_dcids = [p["dcid"] for p in item["info"]["parents"]] + self.assertIn("node10", parent_dcids) + self.assertNotIn("node11", parent_dcids) + + @patch('server.services.datacommons.post') + def test_get_place_info_cycle(self, mock_post): + """Test handling of cycles in parent graph (A -> B -> A).""" + def cycle_side_effect(url, data, api_key=None, log_extreme_calls=False): + if "->containedInPlace" in data.get("property", ""): + nodes = data.get("nodes", []) + resp_data = {} + for node in nodes: + if node == "nodeA": + resp_data[node] = {"arcs": {"containedInPlace": {"nodes": [{"dcid": "nodeB"}]}}} + elif node == "nodeB": + resp_data[node] = {"arcs": {"containedInPlace": {"nodes": [{"dcid": "nodeA"}]}}} + return {"data": resp_data} + # names/types + return {"data": { + "nodeA": {"arcs": {"typeOf": {"nodes": [{"dcid": "Place"}]}, "name": {"nodes": [{"value": "A"}]}}}, + "nodeB": {"arcs": {"typeOf": {"nodes": [{"dcid": "Place"}]}, "name": {"nodes": [{"value": "B"}]}}} + }} + + mock_post.side_effect = cycle_side_effect + + dcids = ["nodeA"] + result = dc.get_place_info(dcids) + + # Should not hang or crash + item = result["data"][0] + parents = item["info"]["parents"] + # nodeA's parents should include nodeB. + # B's parent is A. + # A's ancestors: {B, A} but A is self. + # Logic says: if p != dcid: add p. + # So ancestors of nodeA should count nodeB. + # Ancestors of nodeB (fetching) -> nodeA. + # So nodeA has ancestor nodeB. + self.assertEqual(len(parents), 1) + self.assertEqual(parents[0]["dcid"], "nodeB") + + @patch('server.services.datacommons.post') + def test_get_series_dates_error(self, mock_post): + """Test error handling (e.g. 500 from API).""" + mock_post.side_effect = Exception("API Error") + + # Should raise the exception or handle gracefully? + # Current implementation lets exceptions bubble up usually, or raises ValueError + # verify_live_migration.py catches generic Exception. + # datacommons.py post_wrapper raises ValueError on error status, or bubbles request exceptions. + + with self.assertRaises(Exception): + dc.get_series_dates("geoId/06", "County", ["Var1"]) + diff --git a/server/tests/verify_live_migration.py b/server/tests/verify_live_migration.py new file mode 100644 index 0000000000..d4dcabb4c3 --- /dev/null +++ b/server/tests/verify_live_migration.py @@ -0,0 +1,101 @@ + +import os +import sys + +# Add website/ to path +sys.path.append(os.path.join(os.path.dirname(__file__), '../../')) + +from server.services import datacommons as dc +from flask import Flask + +def verify_get_place_info(): + print(f"DEBUG: datacommons file: {getattr(dc, '__file__', 'unknown')}", flush=True) + print("Verifying get_place_info...", flush=True) + # Test with a known place (California) + dcids = ["geoId/06"] + try: + result = dc.get_place_info(dcids) + print(f"Result for geoId/06: {result}", flush=True) + # Result should be {'data': [{'node': 'geoId/06', 'info': {...}}]} + assert "data" in result, f"'data' not in result: {result}" + data_list = result["data"] + assert len(data_list) > 0, "data list is empty" + + # Find item for geoId/06 + item = next((x for x in data_list if x.get("node") == "geoId/06"), None) + assert item is not None, f"geoId/06 not found in data: {data_list}" + + info = item.get("info", {}) + assert "self" in info, f"self not in info: {info}" + assert "name" in info["self"], f"name not in self info: {info}" + assert "type" in info["self"], f"type not in self info: {info}" + assert "parents" in info, f"parents not in info: {info}" + + # Check parents content + parents = info["parents"] + assert len(parents) > 0, "No parents found" + # Verify USA is in parents + usa = next((p for p in parents if p["dcid"] == "country/USA"), None) + assert usa is not None, "USA not found in parents" + + print("get_place_info: PASS", flush=True) + except Exception as e: + import traceback + traceback.print_exc() + print(f"get_place_info: FAIL - {repr(e)}", flush=True) + import traceback + traceback.print_exc() + +def verify_get_series_dates(): + print("\nVerifying get_series_dates...") + # Test with known entities/variables + parent_entity = "geoId/06" # California + child_type = "County" + variables = ["Count_Person", "Median_Age_Person"] # Common variables + try: + result = dc.get_series_dates(parent_entity, child_type, variables) + print("Result for California counties:", result) + # Basic assertions + assert "datesByVariable" in result + for var in variables: + # We assume at least some data exists for these common vars + if var in result["datesByVariable"]: + print(f" Confirming data for {var}: PASS") + assert len(result["datesByVariable"][var]) > 0 + else: + print(f" Warning: No data for {var}") + print("get_series_dates: PASS") + except Exception as e: + print(f"get_series_dates: FAIL - {e}") + import traceback + traceback.print_exc() + +if __name__ == "__main__": + # Setup Flask app context to load config + app = Flask(__name__) + # Set environment variables if needed + os.environ['FLASK_ENV'] = 'local' + + # We need to manually load config since we aren't running the full app + # But datacommons.py uses `current_app.config['API_ROOT']` if available, + # or defaults to `https://api.datacommons.org`. + # Let's ensure FLASK_ENV is set so if it tries to load config it works. + + # Actually, datacommons.py imports `cfg` from a module level variable? + # No, it uses `current_app.config`. + + with app.app_context(): + # Manually set API_ROOT if needed, but default should work for public data + app.config['API_ROOT'] = 'https://api.datacommons.org' + app.config['SECRET_PROJECT'] = '' # avoid GCP errors if any + app.config['DC_API_KEY'] = os.environ.get('DC_API_KEY', '') + + # Initialize cache to avoid AttributeError + from server.lib import cache as lib_cache + if lib_cache.cache: + lib_cache.cache.init_app(app) + if lib_cache.model_cache: + pass # model_cache might be same as cache or different, but usually we only need main cache for datacommons.py + + verify_get_place_info() + verify_get_series_dates() From 27b5843d702e99d9ae2efbf2ed69c3359bfa9e80 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 2 Mar 2026 22:09:15 +0530 Subject: [PATCH 02/23] Clean up comments and fix bug in get_series_dates --- server/services/datacommons.py | 43 ++++--------- server/tests/migration_verification_test.py | 67 +++------------------ 2 files changed, 21 insertions(+), 89 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 818b4313f6..0caff4320f 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -415,7 +415,7 @@ def get_variable_ancestors(dcid: str): def get_place_info(dcids: List[str]) -> Dict: """Retrieves Place Info given a list of DCIDs.""" - # Step 1: Get ancestors manually since v2/node doesn't support ->containedInPlace+ + # Get ancestors using BFS since v2/node doesn't support recursive ->containedInPlace+ ancestors_map = {dcid: set() for dcid in dcids} parent_graph = {} # child_dcid -> list of parent_dcids @@ -427,12 +427,12 @@ def get_place_info(dcids: List[str]) -> Dict: if not frontier: break - # Filter out already visited nodes to avoid cycles/redundant fetches + # Filter visited nodes to avoid cycles fetch_dcids = [d for d in frontier if d not in visited] if not fetch_dcids: break - # Fetch parents for current frontier + resp = v2node(fetch_dcids, '->containedInPlace') data = resp.get('data', {}) @@ -440,7 +440,7 @@ def get_place_info(dcids: List[str]) -> Dict: for dcid in fetch_dcids: visited.add(dcid) node_data = data.get(dcid, {}) - # Parse arcs: {'nodes': [...]} + arcs_obj = node_data.get('arcs', {}).get('containedInPlace', {}) nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] @@ -451,7 +451,7 @@ def get_place_info(dcids: List[str]) -> Dict: frontier = current_frontier - # Step 2: Build ancestors list for each requested DCID using the graph + # Build ancestors list from the graph for dcid in dcids: queue = [dcid] seen = {dcid} @@ -461,7 +461,7 @@ def get_place_info(dcids: List[str]) -> Dict: for p in parents: if p not in seen: seen.add(p) - # Add to ancestors if it's not the node itself (though p != dcid is implied by hierarchy usually) + # Add to ancestors if it's not the node itself if p != dcid: ancestors_map[dcid].add(p) queue.append(p) @@ -480,9 +480,6 @@ def get_place_info(dcids: List[str]) -> Dict: def get_first_value(resp, dcid, prop, key='dcid'): node_data = resp.get('data', {}).get(dcid, {}) - # Prop might be returned with or without arrow depending on API, - # but usually matches requested property key - # arcs is a dict: { prop: { 'nodes': [...] } } arcs_obj = node_data.get('arcs', {}).get(prop, {}) if not arcs_obj: # Try checking without arrow if key mismatch @@ -531,8 +528,7 @@ def get_first_value(resp, dcid, prop, key='dcid'): def get_series_dates(parent_entity, child_type, variables): """Get series dates.""" - # Step 1: Get children - # Note: This checks for DIRECT children (containedInPlace). + # Get direct children children_resp = v2node([parent_entity], '<-containedInPlace') child_dcids = [] @@ -542,13 +538,10 @@ def get_series_dates(parent_entity, child_type, variables): # Filter by type if there are children if possible_children: - # We need to verify which of these are of child_type - # Optimization: If child_type is generic or we trust, we might skip. - # But V1 likely filtered. + # Filter children by requested type type_resp = v2node(possible_children, 'typeOf') for child in possible_children: - # Check if child has the requested type - # A node can have multiple types. + # Check node types c_data = type_resp.get('data', {}).get(child, {}) c_types = c_data.get('arcs', {}).get('typeOf', []) c_type_ids = [t.get('dcid') for t in c_types] @@ -558,11 +551,7 @@ def get_series_dates(parent_entity, child_type, variables): if not child_dcids: return {"datesByVariable": [], "facets": {}} - # Step 2: Get observation dates - # We use v2observation to get data for these children - # Query for just date and value? V1 returns counts mostly? - # V1 returns: datesByVariable -> [{variable, observationDates: [{date, entityCount: [{count, facet}]}]}] - # To replicate this, we need all observations for these variable/entity pairs. + # Get observation dates for the filtered children obs_resp = v2observation( select=['date', 'variable', 'entity', 'value', 'facet'], @@ -571,17 +560,11 @@ def get_series_dates(parent_entity, child_type, variables): ) # Aggregate results - # Structure: { variable: { date: { facet: count } } } + # Aggregate results: { variable: { date: { facet: count } } } import collections agg_data = collections.defaultdict(lambda: collections.defaultdict(lambda: collections.defaultdict(int))) - # Iterate through the response - # V2 response: { byVariable: { var: { byEntity: { ent: { series: [{date, value, facet or facetId}] } } } } } - # Note: if we passed 'select', the structure might be different? - # v2observation helper uses 'select' but returns the byVariable structure usually? - # Let's check v2observation implementation. It calls post("/v2/observation"). - # The response IS usually byVariable. - + # Iterate through V2 response by_var = obs_resp.get('byVariable', {}) unique_facets = {} # facetId -> facetObj @@ -590,7 +573,7 @@ def get_series_dates(parent_entity, child_type, variables): for var, var_data in by_var.items(): by_ent = var_data.get('byEntity', {}) for ent, ent_data in by_ent.items(): - # ent_data contains 'series' usually + series = ent_data.get('series', []) for obs in series: date = obs.get('date') diff --git a/server/tests/migration_verification_test.py b/server/tests/migration_verification_test.py index dd6cf55124..9a15a82c60 100644 --- a/server/tests/migration_verification_test.py +++ b/server/tests/migration_verification_test.py @@ -11,21 +11,14 @@ def test_get_place_info_v2(self, mock_post): # Setup dcids = ["geoId/06"] - # Mock V2 responses - # We expect 3 calls (ancestors, types, names) or 1 call if we optimize, but Plan says 3. - # Actually, Plan says: - # 1. v2node(dcids, '->containedInPlace+') -> ancestors - # 2. v2node(ancestor_dcids, 'typeOf') -> types - # 3. v2node(ancestor_dcids, 'name') -> names - - # Let's mock side_effect to handle these calls + # Mock V2 responses for ancestors, types, and names + # Mock side_effect to handle these calls def side_effect(url, data, api_key=None, log_extreme_calls=False): prop = data.get("property", "") # Ancestors call (BFS uses ->containedInPlace) if "->containedInPlace" in prop: # Mock returning USA as parent of California - # And nothing for USA (top level for this test) resp_data = {} nodes = data.get("nodes", []) for node in nodes: @@ -40,7 +33,7 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): # no parent for country/USA result in empty dict or just no entry return {"data": resp_data} - # key property call (types or name) + # Key property call (types or name) if "nodes" in data and len(data["nodes"]) > 0: nodes = data["nodes"] if "typeOf" in prop: @@ -62,11 +55,9 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): mock_post.side_effect = side_effect # Execute - # Note: This will fail until we migrate the code result = dc.get_place_info(dcids) # Verify - # Expected V1 structure expected_parents = [ {"dcid": "country/USA", "type": "Country", "name": "United States"} ] @@ -80,18 +71,7 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): self.assertEqual(item["info"]["self"]["type"], "State") self.assertEqual(item["info"]["self"]["name"], "California") - # Verify parents are sorted (Country should be last if sorted by rank? Or first?) - # V1 usually returns specific order. - # Our plan says sort by rank. - # State (20) < Country (30). - # We want topological order. - # The user's request: "parents for sorting parents (City -> State -> Country)" - # So "City" (5) comes before "State" (20). - # So parents list should be sorted by rank? - # Actually V1 `parents` list usually goes from immediate parent up to root. - # So State's parent is Country. - # So `parents` should be `[Country]`. - # If we had City, it would be `[County, State, Country]`. + # Verify parents are sorted self.assertEqual(item["info"]["parents"], expected_parents) @patch('server.services.datacommons.post') @@ -102,7 +82,7 @@ def test_get_series_dates_v2(self, mock_post): variables = ["Count_Person"] def side_effect(url, data, api_key=None, log_extreme_calls=False): - # Step 1: Child nodes + # Child nodes if "<-containedInPlace" in data.get("property", ""): return { "data": { @@ -116,7 +96,7 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): } } } - # Step 1.5: Child types + # Child types if "typeOf" in data.get("property", ""): return { "data": { @@ -124,7 +104,7 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): "geoId/06085": {"arcs": {"typeOf": [{"dcid": "County"}]}} } } - # Step 2: Observations + # Observations if "variable" in data and "entity" in data: return { "byVariable": { @@ -153,18 +133,6 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): result = dc.get_series_dates(parent_entity, child_type, variables) # Verify - # Expected V1 structure: - # { - # "datesByVariable": [ - # { - # "variable": "Count_Person", - # "observationDates": [ - # { "date": "2020", "entityCount": [{ "count": 2, "facet": "" }] }, - # { "date": "2021", "entityCount": [{ "count": 1, "facet": "" }] } - # ] - # } - # ] - # } self.assertIn("datesByVariable", result) self.assertEqual(len(result["datesByVariable"]), 1) var_data = result["datesByVariable"][0] @@ -182,7 +150,6 @@ def test_get_place_info_edge_cases(self, mock_post): """Test recursion limits, cycles, and missing data for get_place_info.""" # Scenario 1: Max Recursion Depth (Chain > 10 levels) - # Chain: node0 -> node1 -> ... -> node15 # We expect it to stop at level 10. def recursion_side_effect(url, data, api_key=None, log_extreme_calls=False): if "->containedInPlace" in data.get("property", ""): @@ -197,7 +164,6 @@ def recursion_side_effect(url, data, api_key=None, log_extreme_calls=False): parent = f"node{idx+1}" resp_data[node] = { "arcs": { - # Use correct V2 structure: dict with 'nodes' key "containedInPlace": { "nodes": [{"dcid": parent}] } @@ -229,12 +195,6 @@ def recursion_side_effect(url, data, api_key=None, log_extreme_calls=False): self.assertIn("data", result) item = result["data"][0] # We expect parents to contain node1..node10 (10 levels) - # logic: loop runs 10 times. - # it finds parents. - # Max ancestors should be limited. - # Actually logic is: for _ in range(10). - # So it fetches 10 levels of parents. - # Ancestors will include node1 to node10. self.assertEqual(len(item["info"]["parents"]), 10) parent_dcids = [p["dcid"] for p in item["info"]["parents"]] self.assertIn("node10", parent_dcids) @@ -267,13 +227,7 @@ def cycle_side_effect(url, data, api_key=None, log_extreme_calls=False): # Should not hang or crash item = result["data"][0] parents = item["info"]["parents"] - # nodeA's parents should include nodeB. - # B's parent is A. - # A's ancestors: {B, A} but A is self. - # Logic says: if p != dcid: add p. - # So ancestors of nodeA should count nodeB. - # Ancestors of nodeB (fetching) -> nodeA. - # So nodeA has ancestor nodeB. + # nodeA's parents should include nodeB. self.assertEqual(len(parents), 1) self.assertEqual(parents[0]["dcid"], "nodeB") @@ -282,11 +236,6 @@ def test_get_series_dates_error(self, mock_post): """Test error handling (e.g. 500 from API).""" mock_post.side_effect = Exception("API Error") - # Should raise the exception or handle gracefully? - # Current implementation lets exceptions bubble up usually, or raises ValueError - # verify_live_migration.py catches generic Exception. - # datacommons.py post_wrapper raises ValueError on error status, or bubbles request exceptions. - with self.assertRaises(Exception): dc.get_series_dates("geoId/06", "County", ["Var1"]) From 8951e07d9df45410ef68addc4fa198026246558d Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 2 Mar 2026 22:26:19 +0530 Subject: [PATCH 03/23] Untrack verify_live_migration.py to exclude from PR --- server/tests/verify_live_migration.py | 101 -------------------------- 1 file changed, 101 deletions(-) delete mode 100644 server/tests/verify_live_migration.py diff --git a/server/tests/verify_live_migration.py b/server/tests/verify_live_migration.py deleted file mode 100644 index d4dcabb4c3..0000000000 --- a/server/tests/verify_live_migration.py +++ /dev/null @@ -1,101 +0,0 @@ - -import os -import sys - -# Add website/ to path -sys.path.append(os.path.join(os.path.dirname(__file__), '../../')) - -from server.services import datacommons as dc -from flask import Flask - -def verify_get_place_info(): - print(f"DEBUG: datacommons file: {getattr(dc, '__file__', 'unknown')}", flush=True) - print("Verifying get_place_info...", flush=True) - # Test with a known place (California) - dcids = ["geoId/06"] - try: - result = dc.get_place_info(dcids) - print(f"Result for geoId/06: {result}", flush=True) - # Result should be {'data': [{'node': 'geoId/06', 'info': {...}}]} - assert "data" in result, f"'data' not in result: {result}" - data_list = result["data"] - assert len(data_list) > 0, "data list is empty" - - # Find item for geoId/06 - item = next((x for x in data_list if x.get("node") == "geoId/06"), None) - assert item is not None, f"geoId/06 not found in data: {data_list}" - - info = item.get("info", {}) - assert "self" in info, f"self not in info: {info}" - assert "name" in info["self"], f"name not in self info: {info}" - assert "type" in info["self"], f"type not in self info: {info}" - assert "parents" in info, f"parents not in info: {info}" - - # Check parents content - parents = info["parents"] - assert len(parents) > 0, "No parents found" - # Verify USA is in parents - usa = next((p for p in parents if p["dcid"] == "country/USA"), None) - assert usa is not None, "USA not found in parents" - - print("get_place_info: PASS", flush=True) - except Exception as e: - import traceback - traceback.print_exc() - print(f"get_place_info: FAIL - {repr(e)}", flush=True) - import traceback - traceback.print_exc() - -def verify_get_series_dates(): - print("\nVerifying get_series_dates...") - # Test with known entities/variables - parent_entity = "geoId/06" # California - child_type = "County" - variables = ["Count_Person", "Median_Age_Person"] # Common variables - try: - result = dc.get_series_dates(parent_entity, child_type, variables) - print("Result for California counties:", result) - # Basic assertions - assert "datesByVariable" in result - for var in variables: - # We assume at least some data exists for these common vars - if var in result["datesByVariable"]: - print(f" Confirming data for {var}: PASS") - assert len(result["datesByVariable"][var]) > 0 - else: - print(f" Warning: No data for {var}") - print("get_series_dates: PASS") - except Exception as e: - print(f"get_series_dates: FAIL - {e}") - import traceback - traceback.print_exc() - -if __name__ == "__main__": - # Setup Flask app context to load config - app = Flask(__name__) - # Set environment variables if needed - os.environ['FLASK_ENV'] = 'local' - - # We need to manually load config since we aren't running the full app - # But datacommons.py uses `current_app.config['API_ROOT']` if available, - # or defaults to `https://api.datacommons.org`. - # Let's ensure FLASK_ENV is set so if it tries to load config it works. - - # Actually, datacommons.py imports `cfg` from a module level variable? - # No, it uses `current_app.config`. - - with app.app_context(): - # Manually set API_ROOT if needed, but default should work for public data - app.config['API_ROOT'] = 'https://api.datacommons.org' - app.config['SECRET_PROJECT'] = '' # avoid GCP errors if any - app.config['DC_API_KEY'] = os.environ.get('DC_API_KEY', '') - - # Initialize cache to avoid AttributeError - from server.lib import cache as lib_cache - if lib_cache.cache: - lib_cache.cache.init_app(app) - if lib_cache.model_cache: - pass # model_cache might be same as cache or different, but usually we only need main cache for datacommons.py - - verify_get_place_info() - verify_get_series_dates() From e2a3d92dc1ef654548b3a47dc8e8539ae6c5fca0 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 2 Mar 2026 22:36:55 +0530 Subject: [PATCH 04/23] Address review comments: Fix V2 API parsing and optimize BFS --- server/services/datacommons.py | 15 ++++++++------- server/tests/migration_verification_test.py | 14 ++++++++------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 0caff4320f..f8fd3ca8b8 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -14,6 +14,7 @@ """Copy of Data Commons Python Client API Core without pandas dependency.""" import asyncio +import collections import json import logging from typing import Dict, List @@ -453,10 +454,10 @@ def get_place_info(dcids: List[str]) -> Dict: # Build ancestors list from the graph for dcid in dcids: - queue = [dcid] + queue = collections.deque([dcid]) seen = {dcid} while queue: - curr = queue.pop(0) + curr = queue.popleft() parents = parent_graph.get(curr, []) for p in parents: if p not in seen: @@ -533,8 +534,9 @@ def get_series_dates(parent_entity, child_type, variables): child_dcids = [] node_data = children_resp.get('data', {}).get(parent_entity, {}) - arcs = node_data.get('arcs', {}).get('containedInPlace', []) - possible_children = [x['dcid'] for x in arcs if 'dcid' in x] + arcs_obj = node_data.get('arcs', {}).get('containedInPlace', {}) + nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] + possible_children = [x['dcid'] for x in nodes_list if 'dcid' in x] # Filter by type if there are children if possible_children: @@ -543,7 +545,8 @@ def get_series_dates(parent_entity, child_type, variables): for child in possible_children: # Check node types c_data = type_resp.get('data', {}).get(child, {}) - c_types = c_data.get('arcs', {}).get('typeOf', []) + c_arcs = c_data.get('arcs', {}).get('typeOf', {}) + c_types = c_arcs.get('nodes', []) if isinstance(c_arcs, dict) else [] c_type_ids = [t.get('dcid') for t in c_types] if child_type in c_type_ids: child_dcids.append(child) @@ -561,12 +564,10 @@ def get_series_dates(parent_entity, child_type, variables): # Aggregate results # Aggregate results: { variable: { date: { facet: count } } } - import collections agg_data = collections.defaultdict(lambda: collections.defaultdict(lambda: collections.defaultdict(int))) # Iterate through V2 response by_var = obs_resp.get('byVariable', {}) - unique_facets = {} # facetId -> facetObj all_facets = obs_resp.get('facets', {}) diff --git a/server/tests/migration_verification_test.py b/server/tests/migration_verification_test.py index 9a15a82c60..09593e5898 100644 --- a/server/tests/migration_verification_test.py +++ b/server/tests/migration_verification_test.py @@ -88,10 +88,12 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): "data": { "geoId/06": { "arcs": { - "containedInPlace": [ - {"dcid": "geoId/06001", "name": "Alameda County", "types": ["County"]}, - {"dcid": "geoId/06085", "name": "Santa Clara County", "types": ["County"]} - ] + "containedInPlace": { + "nodes": [ + {"dcid": "geoId/06001", "name": "Alameda County", "types": ["County"]}, + {"dcid": "geoId/06085", "name": "Santa Clara County", "types": ["County"]} + ] + } } } } @@ -100,8 +102,8 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): if "typeOf" in data.get("property", ""): return { "data": { - "geoId/06001": {"arcs": {"typeOf": [{"dcid": "County"}]}}, - "geoId/06085": {"arcs": {"typeOf": [{"dcid": "County"}]}} + "geoId/06001": {"arcs": {"typeOf": {"nodes": [{"dcid": "County"}]}}}, + "geoId/06085": {"arcs": {"typeOf": {"nodes": [{"dcid": "County"}]}}} } } # Observations From 1c8e04dffeb5a4395241b7e5f3ffa8d30849d748 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 2 Mar 2026 22:54:11 +0530 Subject: [PATCH 05/23] Fix linting and formatting issues in V2 migration files --- server/services/datacommons.py | 312 +++++------ server/tests/migration_verification_test.py | 570 ++++++++++++-------- 2 files changed, 502 insertions(+), 380 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index f8fd3ca8b8..e64d0a83e8 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -371,8 +371,6 @@ def v2event(node, prop): return post(url, {"node": node, "property": prop}) - - def get_variable_group_info(nodes: List[str], entities: List[str], numEntitiesExistence=1) -> Dict: @@ -402,13 +400,24 @@ def get_variable_ancestors(dcid: str): PLACE_TYPE_RANK = { "CensusZipCodeTabulationArea": 1, - "AdministrativeArea5": 2, "AdministrativeArea4": 2, - "Village": 5, "City": 5, "Town": 5, "Borough": 5, "AdministrativeArea3": 5, - "County": 10, "AdministrativeArea2": 10, "EurostatNUTS3": 10, + "AdministrativeArea5": 2, + "AdministrativeArea4": 2, + "Village": 5, + "City": 5, + "Town": 5, + "Borough": 5, + "AdministrativeArea3": 5, + "County": 10, + "AdministrativeArea2": 10, + "EurostatNUTS3": 10, "CensusDivision": 15, - "State": 20, "AdministrativeArea1": 20, "EurostatNUTS2": 20, "EurostatNUTS1": 20, + "State": 20, + "AdministrativeArea1": 20, + "EurostatNUTS2": 20, + "EurostatNUTS1": 20, "Country": 30, - "CensusRegion": 35, "GeoRegion": 38, + "CensusRegion": 35, + "GeoRegion": 38, "Continent": 40, "Place": 50, } @@ -418,112 +427,117 @@ def get_place_info(dcids: List[str]) -> Dict: """Retrieves Place Info given a list of DCIDs.""" # Get ancestors using BFS since v2/node doesn't support recursive ->containedInPlace+ ancestors_map = {dcid: set() for dcid in dcids} - - parent_graph = {} # child_dcid -> list of parent_dcids + + parent_graph = {} # child_dcid -> list of parent_dcids frontier = set(dcids) visited = set() - + # BFS to build parent graph (max depth 10) for _ in range(10): - if not frontier: - break - - # Filter visited nodes to avoid cycles - fetch_dcids = [d for d in frontier if d not in visited] - if not fetch_dcids: - break - - - resp = v2node(fetch_dcids, '->containedInPlace') - data = resp.get('data', {}) - - current_frontier = set() - for dcid in fetch_dcids: - visited.add(dcid) - node_data = data.get(dcid, {}) - - arcs_obj = node_data.get('arcs', {}).get('containedInPlace', {}) - nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] - - parents = [x['dcid'] for x in nodes_list if 'dcid' in x] - if parents: - parent_graph[dcid] = parents - current_frontier.update(parents) - - frontier = current_frontier - + if not frontier: + break + + # Filter visited nodes to avoid cycles + fetch_dcids = [d for d in frontier if d not in visited] + if not fetch_dcids: + break + + resp = v2node(fetch_dcids, '->containedInPlace') + data = resp.get('data', {}) + + current_frontier = set() + for dcid in fetch_dcids: + visited.add(dcid) + node_data = data.get(dcid, {}) + + arcs_obj = node_data.get('arcs', {}).get('containedInPlace', {}) + nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, + dict) else [] + + parents = [x['dcid'] for x in nodes_list if 'dcid' in x] + if parents: + parent_graph[dcid] = parents + current_frontier.update(parents) + + frontier = current_frontier + # Build ancestors list from the graph for dcid in dcids: - queue = collections.deque([dcid]) - seen = {dcid} - while queue: - curr = queue.popleft() - parents = parent_graph.get(curr, []) - for p in parents: - if p not in seen: - seen.add(p) - # Add to ancestors if it's not the node itself - if p != dcid: - ancestors_map[dcid].add(p) - queue.append(p) + queue = collections.deque([dcid]) + seen = {dcid} + while queue: + curr = queue.popleft() + parents = parent_graph.get(curr, []) + for p in parents: + if p not in seen: + seen.add(p) + # Add to ancestors if it's not the node itself + if p != dcid: + ancestors_map[dcid].add(p) + queue.append(p) all_dcids = set() for anc_set in ancestors_map.values(): - all_dcids.update(anc_set) + all_dcids.update(anc_set) all_dcids.update(dcids) all_dcids_list = sorted(list(all_dcids)) if not all_dcids_list: - return {'data': []} + return {'data': []} types_resp = v2node(all_dcids_list, '->typeOf') names_resp = v2node(all_dcids_list, '->name') - + def get_first_value(resp, dcid, prop, key='dcid'): - node_data = resp.get('data', {}).get(dcid, {}) - arcs_obj = node_data.get('arcs', {}).get(prop, {}) - if not arcs_obj: - # Try checking without arrow if key mismatch - arcs_obj = node_data.get('arcs', {}).get(prop.replace('->', ''), {}) - - nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] - - if nodes_list: - return nodes_list[0].get(key, '') - return '' + node_data = resp.get('data', {}).get(dcid, {}) + arcs_obj = node_data.get('arcs', {}).get(prop, {}) + if not arcs_obj: + # Try checking without arrow if key mismatch + arcs_obj = node_data.get('arcs', {}).get(prop.replace('->', ''), {}) + + nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] + + if nodes_list: + return nodes_list[0].get(key, '') + return '' result_data = [] for dcid in dcids: - self_type = get_first_value(types_resp, dcid, 'typeOf') - self_name = get_first_value(names_resp, dcid, 'name', 'value') - - parents = [] - for anc_dcid in ancestors_map.get(dcid, []): - if anc_dcid == dcid: continue - - anc_type = get_first_value(types_resp, anc_dcid, 'typeOf') - anc_name = get_first_value(names_resp, anc_dcid, 'name', 'value') - - if anc_type in PLACE_TYPE_RANK: - parents.append({ - 'dcid': anc_dcid, - 'type': anc_type, - 'name': anc_name, - 'rank': PLACE_TYPE_RANK[anc_type] - }) - - parents.sort(key=lambda x: x['rank']) - for p in parents: - del p['rank'] - - result_data.append({ - 'node': dcid, - 'info': { - 'self': {'dcid': dcid, 'type': self_type, 'name': self_name}, - 'parents': parents - } - }) - + self_type = get_first_value(types_resp, dcid, 'typeOf') + self_name = get_first_value(names_resp, dcid, 'name', 'value') + + parents = [] + for anc_dcid in ancestors_map.get(dcid, []): + if anc_dcid == dcid: + continue + + anc_type = get_first_value(types_resp, anc_dcid, 'typeOf') + anc_name = get_first_value(names_resp, anc_dcid, 'name', 'value') + + if anc_type in PLACE_TYPE_RANK: + parents.append({ + 'dcid': anc_dcid, + 'type': anc_type, + 'name': anc_name, + 'rank': PLACE_TYPE_RANK[anc_type] + }) + + parents.sort(key=lambda x: x['rank']) + for p in parents: + del p['rank'] + + result_data.append({ + 'node': dcid, + 'info': { + 'self': { + 'dcid': dcid, + 'type': self_type, + 'name': self_name + }, + 'parents': parents + } + }) + return {'data': result_data} @@ -532,88 +546,80 @@ def get_series_dates(parent_entity, child_type, variables): # Get direct children children_resp = v2node([parent_entity], '<-containedInPlace') child_dcids = [] - + node_data = children_resp.get('data', {}).get(parent_entity, {}) arcs_obj = node_data.get('arcs', {}).get('containedInPlace', {}) nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] possible_children = [x['dcid'] for x in nodes_list if 'dcid' in x] - + # Filter by type if there are children if possible_children: - # Filter children by requested type - type_resp = v2node(possible_children, 'typeOf') - for child in possible_children: - # Check node types - c_data = type_resp.get('data', {}).get(child, {}) - c_arcs = c_data.get('arcs', {}).get('typeOf', {}) - c_types = c_arcs.get('nodes', []) if isinstance(c_arcs, dict) else [] - c_type_ids = [t.get('dcid') for t in c_types] - if child_type in c_type_ids: - child_dcids.append(child) - + # Filter children by requested type + type_resp = v2node(possible_children, 'typeOf') + for child in possible_children: + # Check node types + c_data = type_resp.get('data', {}).get(child, {}) + c_arcs = c_data.get('arcs', {}).get('typeOf', {}) + c_types = c_arcs.get('nodes', []) if isinstance(c_arcs, dict) else [] + c_type_ids = [t.get('dcid') for t in c_types] + if child_type in c_type_ids: + child_dcids.append(child) + if not child_dcids: - return {"datesByVariable": [], "facets": {}} + return {"datesByVariable": [], "facets": {}} # Get observation dates for the filtered children - + obs_resp = v2observation( select=['date', 'variable', 'entity', 'value', 'facet'], entity={'dcids': child_dcids}, - variable={'dcids': variables} - ) - + variable={'dcids': variables}) + # Aggregate results # Aggregate results: { variable: { date: { facet: count } } } - agg_data = collections.defaultdict(lambda: collections.defaultdict(lambda: collections.defaultdict(int))) - + agg_data = collections.defaultdict( + lambda: collections.defaultdict(lambda: collections.defaultdict(int))) + # Iterate through V2 response by_var = obs_resp.get('byVariable', {}) - + all_facets = obs_resp.get('facets', {}) for var, var_data in by_var.items(): - by_ent = var_data.get('byEntity', {}) - for ent, ent_data in by_ent.items(): - - series = ent_data.get('series', []) - for obs in series: - date = obs.get('date') - if not date: continue - - # Facet handling - facet_id = obs.get('facet', "") - agg_data[var][date][facet_id] += 1 - # Assuming facets details are in 'facets' key of response? - # v2observation response should have 'facets' top level key if requested? - # 'facet' in select might return the ID in the series or the object? - # Usually it returns facetID and a top-level facets map. - + by_ent = var_data.get('byEntity', {}) + for ent, ent_data in by_ent.items(): + + series = ent_data.get('series', []) + for obs in series: + date = obs.get('date') + if not date: + continue + + # Facet handling + facet_id = obs.get('facet', "") + agg_data[var][date][facet_id] += 1 + # Assuming facets details are in 'facets' key of response? + # v2observation response should have 'facets' top level key if requested? + # 'facet' in select might return the ID in the series or the object? + # Usually it returns facetID and a top-level facets map. + # Construct response resp_dates = [] for var, dates_map in agg_data.items(): - obs_dates = [] - for date, facet_counts in dates_map.items(): - entity_counts = [] - for facet_id, count in facet_counts.items(): - entity_counts.append({ - "count": count, - "facet": facet_id # V1 expects facet ID or object? - # V1 proto: EntityCount { count, facet } where facet is string (ID?). - # But typically it might expect the full facet object in a separate map. - }) - obs_dates.append({ - "date": date, - "entityCount": entity_counts - }) - resp_dates.append({ - "variable": var, - "observationDates": obs_dates - }) - - return { - "datesByVariable": resp_dates, - "facets": all_facets - } + obs_dates = [] + for date, facet_counts in dates_map.items(): + entity_counts = [] + for facet_id, count in facet_counts.items(): + entity_counts.append({ + "count": count, + "facet": facet_id # V1 expects facet ID or object? + # V1 proto: EntityCount { count, facet } where facet is string (ID?). + # But typically it might expect the full facet object in a separate map. + }) + obs_dates.append({"date": date, "entityCount": entity_counts}) + resp_dates.append({"variable": var, "observationDates": obs_dates}) + + return {"datesByVariable": resp_dates, "facets": all_facets} def resolve(nodes, prop): diff --git a/server/tests/migration_verification_test.py b/server/tests/migration_verification_test.py index 09593e5898..f33d88106c 100644 --- a/server/tests/migration_verification_test.py +++ b/server/tests/migration_verification_test.py @@ -1,243 +1,359 @@ - +import json import unittest from unittest.mock import patch + from server.services import datacommons as dc -import json + class TestMigrationVerification(unittest.TestCase): - @patch('server.services.datacommons.post') - def test_get_place_info_v2(self, mock_post): - # Setup - dcids = ["geoId/06"] - - # Mock V2 responses for ancestors, types, and names - # Mock side_effect to handle these calls - def side_effect(url, data, api_key=None, log_extreme_calls=False): - prop = data.get("property", "") - - # Ancestors call (BFS uses ->containedInPlace) - if "->containedInPlace" in prop: - # Mock returning USA as parent of California - resp_data = {} - nodes = data.get("nodes", []) - for node in nodes: - if node == "geoId/06": - resp_data[node] = { - "arcs": { - "containedInPlace": { - "nodes": [{"dcid": "country/USA"}] - } - } + @patch('server.services.datacommons.post') + def test_get_place_info_v2(self, mock_post): + # Setup + dcids = ["geoId/06"] + + # Mock V2 responses for ancestors, types, and names + # Mock side_effect to handle these calls + def side_effect(url, data, api_key=None, log_extreme_calls=False): + prop = data.get("property", "") + + # Ancestors call (BFS uses ->containedInPlace) + if "->containedInPlace" in prop: + # Mock returning USA as parent of California + resp_data = {} + nodes = data.get("nodes", []) + for node in nodes: + if node == "geoId/06": + resp_data[node] = { + "arcs": { + "containedInPlace": { + "nodes": [{ + "dcid": "country/USA" + }] + } + } + } + # no parent for country/USA result in empty dict or just no entry + return {"data": resp_data} + + # Key property call (types or name) + if "nodes" in data and len(data["nodes"]) > 0: + nodes = data["nodes"] + if "typeOf" in prop: + return { + "data": { + "country/USA": { + "arcs": { + "typeOf": { + "nodes": [{ + "dcid": "Country" + }] + } + } + }, + "geoId/06": { + "arcs": { + "typeOf": { + "nodes": [{ + "dcid": "State" + }] + } + } + } + } + } + if "name" in prop: + return { + "data": { + "country/USA": { + "arcs": { + "name": { + "nodes": [{ + "value": "United States" + }] + } + } + }, + "geoId/06": { + "arcs": { + "name": { + "nodes": [{ + "value": "California" + }] + } + } + } + } + } + return {} + + mock_post.side_effect = side_effect + + # Execute + result = dc.get_place_info(dcids) + + # Verify + expected_parents = [{ + "dcid": "country/USA", + "type": "Country", + "name": "United States" + }] + + self.assertIn("data", result) + self.assertEqual(len(result["data"]), 1) + item = result["data"][0] + self.assertEqual(item["node"], "geoId/06") + self.assertIn("info", item) + self.assertEqual(item["info"]["self"]["dcid"], "geoId/06") + self.assertEqual(item["info"]["self"]["type"], "State") + self.assertEqual(item["info"]["self"]["name"], "California") + + # Verify parents are sorted + self.assertEqual(item["info"]["parents"], expected_parents) + + @patch('server.services.datacommons.post') + def test_get_series_dates_v2(self, mock_post): + # Setup + parent_entity = "geoId/06" + child_type = "County" + variables = ["Count_Person"] + + def side_effect(url, data, api_key=None, log_extreme_calls=False): + # Child nodes + if "<-containedInPlace" in data.get("property", ""): + return { + "data": { + "geoId/06": { + "arcs": { + "containedInPlace": { + "nodes": [{ + "dcid": "geoId/06001", + "name": "Alameda County", + "types": ["County"] + }, { + "dcid": "geoId/06085", + "name": "Santa Clara County", + "types": ["County"] + }] } - # no parent for country/USA result in empty dict or just no entry - return {"data": resp_data} - - # Key property call (types or name) - if "nodes" in data and len(data["nodes"]) > 0: - nodes = data["nodes"] - if "typeOf" in prop: - return { - "data": { - "country/USA": {"arcs": {"typeOf": {"nodes": [{"dcid": "Country"}]}}}, - "geoId/06": {"arcs": {"typeOf": {"nodes": [{"dcid": "State"}]}}} + } + } + } + } + # Child types + if "typeOf" in data.get("property", ""): + return { + "data": { + "geoId/06001": { + "arcs": { + "typeOf": { + "nodes": [{ + "dcid": "County" + }] } } - if "name" in prop: - return { - "data": { - "country/USA": {"arcs": {"name": {"nodes": [{"value": "United States"}]}}}, - "geoId/06": {"arcs": {"name": {"nodes": [{"value": "California"}]}}} + }, + "geoId/06085": { + "arcs": { + "typeOf": { + "nodes": [{ + "dcid": "County" + }] } } - return {} - - mock_post.side_effect = side_effect - - # Execute - result = dc.get_place_info(dcids) - - # Verify - expected_parents = [ - {"dcid": "country/USA", "type": "Country", "name": "United States"} - ] - - self.assertIn("data", result) - self.assertEqual(len(result["data"]), 1) - item = result["data"][0] - self.assertEqual(item["node"], "geoId/06") - self.assertIn("info", item) - self.assertEqual(item["info"]["self"]["dcid"], "geoId/06") - self.assertEqual(item["info"]["self"]["type"], "State") - self.assertEqual(item["info"]["self"]["name"], "California") - - # Verify parents are sorted - self.assertEqual(item["info"]["parents"], expected_parents) - - @patch('server.services.datacommons.post') - def test_get_series_dates_v2(self, mock_post): - # Setup - parent_entity = "geoId/06" - child_type = "County" - variables = ["Count_Person"] - - def side_effect(url, data, api_key=None, log_extreme_calls=False): - # Child nodes - if "<-containedInPlace" in data.get("property", ""): - return { - "data": { - "geoId/06": { - "arcs": { - "containedInPlace": { - "nodes": [ - {"dcid": "geoId/06001", "name": "Alameda County", "types": ["County"]}, - {"dcid": "geoId/06085", "name": "Santa Clara County", "types": ["County"]} - ] - } - } + } + } + } + # Observations + if "variable" in data and "entity" in data: + return { + "byVariable": { + "Count_Person": { + "byEntity": { + "geoId/06001": { + "series": [{ + "date": "2020", + "value": 100 + }] + }, + "geoId/06085": { + "series": [{ + "date": "2020", + "value": 200 + }, { + "date": "2021", + "value": 210 + }] } } } - # Child types - if "typeOf" in data.get("property", ""): - return { - "data": { - "geoId/06001": {"arcs": {"typeOf": {"nodes": [{"dcid": "County"}]}}}, - "geoId/06085": {"arcs": {"typeOf": {"nodes": [{"dcid": "County"}]}}} + } + } + return {} + + mock_post.side_effect = side_effect + + # Execute + result = dc.get_series_dates(parent_entity, child_type, variables) + + # Verify + self.assertIn("datesByVariable", result) + self.assertEqual(len(result["datesByVariable"]), 1) + var_data = result["datesByVariable"][0] + self.assertEqual(var_data["variable"], "Count_Person") + + dates = {d["date"]: d for d in var_data["observationDates"]} + self.assertIn("2020", dates) + self.assertEqual(dates["2020"]["entityCount"][0]["count"], 2) + + self.assertIn("2021", dates) + self.assertEqual(dates["2021"]["entityCount"][0]["count"], 1) + + @patch('server.services.datacommons.post') + def test_get_place_info_edge_cases(self, mock_post): + """Test recursion limits, cycles, and missing data for get_place_info.""" + + # Scenario 1: Max Recursion Depth (Chain > 10 levels) + # We expect it to stop at level 10. + def recursion_side_effect(url, data, api_key=None, log_extreme_calls=False): + if "->containedInPlace" in data.get("property", ""): + # Expect 'nodes' in payload + nodes = data.get("nodes", []) + resp_data = {} + for node in nodes: + if node.startswith("node"): + try: + idx = int(node[4:]) + if idx < 15: # Create chain up to 15 + parent = f"node{idx+1}" + resp_data[node] = { + "arcs": { + "containedInPlace": { + "nodes": [{ + "dcid": parent + }] + } } - } - # Observations - if "variable" in data and "entity" in data: - return { - "byVariable": { - "Count_Person": { - "byEntity": { - "geoId/06001": { - "series": [ - {"date": "2020", "value": 100} - ] - }, - "geoId/06085": { - "series": [ - {"date": "2020", "value": 200}, - {"date": "2021", "value": 210} - ] - } - } - } - } - } - return {} - - mock_post.side_effect = side_effect - - # Execute - result = dc.get_series_dates(parent_entity, child_type, variables) - - # Verify - self.assertIn("datesByVariable", result) - self.assertEqual(len(result["datesByVariable"]), 1) - var_data = result["datesByVariable"][0] - self.assertEqual(var_data["variable"], "Count_Person") - - dates = {d["date"]: d for d in var_data["observationDates"]} - self.assertIn("2020", dates) - self.assertEqual(dates["2020"]["entityCount"][0]["count"], 2) - - self.assertIn("2021", dates) - self.assertEqual(dates["2021"]["entityCount"][0]["count"], 1) - - @patch('server.services.datacommons.post') - def test_get_place_info_edge_cases(self, mock_post): - """Test recursion limits, cycles, and missing data for get_place_info.""" - - # Scenario 1: Max Recursion Depth (Chain > 10 levels) - # We expect it to stop at level 10. - def recursion_side_effect(url, data, api_key=None, log_extreme_calls=False): - if "->containedInPlace" in data.get("property", ""): - # Expect 'nodes' in payload - nodes = data.get("nodes", []) - resp_data = {} - for node in nodes: - if node.startswith("node"): - try: - idx = int(node[4:]) - if idx < 15: # Create chain up to 15 - parent = f"node{idx+1}" - resp_data[node] = { - "arcs": { - "containedInPlace": { - "nodes": [{"dcid": parent}] - } - } - } - except ValueError: - pass - return {"data": resp_data} - - # For types/names, return dummy data - if "nodes" in data: - resp_data = {} - for node in data["nodes"]: - resp_data[node] = { - "arcs": { - "typeOf": {"nodes": [{"dcid": "Place"}]}, - "name": {"nodes": [{"value": f"Name {node}"}]} - } - } - return {"data": resp_data} - return {} - - mock_post.side_effect = recursion_side_effect - - # Test max depth - dcids = ["node0"] - result = dc.get_place_info(dcids) - - self.assertIn("data", result) - item = result["data"][0] - # We expect parents to contain node1..node10 (10 levels) - self.assertEqual(len(item["info"]["parents"]), 10) - parent_dcids = [p["dcid"] for p in item["info"]["parents"]] - self.assertIn("node10", parent_dcids) - self.assertNotIn("node11", parent_dcids) - - @patch('server.services.datacommons.post') - def test_get_place_info_cycle(self, mock_post): - """Test handling of cycles in parent graph (A -> B -> A).""" - def cycle_side_effect(url, data, api_key=None, log_extreme_calls=False): - if "->containedInPlace" in data.get("property", ""): - nodes = data.get("nodes", []) - resp_data = {} - for node in nodes: - if node == "nodeA": - resp_data[node] = {"arcs": {"containedInPlace": {"nodes": [{"dcid": "nodeB"}]}}} - elif node == "nodeB": - resp_data[node] = {"arcs": {"containedInPlace": {"nodes": [{"dcid": "nodeA"}]}}} - return {"data": resp_data} - # names/types - return {"data": { - "nodeA": {"arcs": {"typeOf": {"nodes": [{"dcid": "Place"}]}, "name": {"nodes": [{"value": "A"}]}}}, - "nodeB": {"arcs": {"typeOf": {"nodes": [{"dcid": "Place"}]}, "name": {"nodes": [{"value": "B"}]}}} - }} - - mock_post.side_effect = cycle_side_effect - - dcids = ["nodeA"] - result = dc.get_place_info(dcids) - - # Should not hang or crash - item = result["data"][0] - parents = item["info"]["parents"] - # nodeA's parents should include nodeB. - self.assertEqual(len(parents), 1) - self.assertEqual(parents[0]["dcid"], "nodeB") - - @patch('server.services.datacommons.post') - def test_get_series_dates_error(self, mock_post): - """Test error handling (e.g. 500 from API).""" - mock_post.side_effect = Exception("API Error") - - with self.assertRaises(Exception): - dc.get_series_dates("geoId/06", "County", ["Var1"]) + } + except ValueError: + pass + return {"data": resp_data} + + # For types/names, return dummy data + if "nodes" in data: + resp_data = {} + for node in data["nodes"]: + resp_data[node] = { + "arcs": { + "typeOf": { + "nodes": [{ + "dcid": "Place" + }] + }, + "name": { + "nodes": [{ + "value": f"Name {node}" + }] + } + } + } + return {"data": resp_data} + return {} + + mock_post.side_effect = recursion_side_effect + + # Test max depth + dcids = ["node0"] + result = dc.get_place_info(dcids) + + self.assertIn("data", result) + item = result["data"][0] + # We expect parents to contain node1..node10 (10 levels) + self.assertEqual(len(item["info"]["parents"]), 10) + parent_dcids = [p["dcid"] for p in item["info"]["parents"]] + self.assertIn("node10", parent_dcids) + self.assertNotIn("node11", parent_dcids) + + @patch('server.services.datacommons.post') + def test_get_place_info_cycle(self, mock_post): + """Test handling of cycles in parent graph (A -> B -> A).""" + + def cycle_side_effect(url, data, api_key=None, log_extreme_calls=False): + if "->containedInPlace" in data.get("property", ""): + nodes = data.get("nodes", []) + resp_data = {} + for node in nodes: + if node == "nodeA": + resp_data[node] = { + "arcs": { + "containedInPlace": { + "nodes": [{ + "dcid": "nodeB" + }] + } + } + } + elif node == "nodeB": + resp_data[node] = { + "arcs": { + "containedInPlace": { + "nodes": [{ + "dcid": "nodeA" + }] + } + } + } + return {"data": resp_data} + # names/types + return { + "data": { + "nodeA": { + "arcs": { + "typeOf": { + "nodes": [{ + "dcid": "Place" + }] + }, + "name": { + "nodes": [{ + "value": "A" + }] + } + } + }, + "nodeB": { + "arcs": { + "typeOf": { + "nodes": [{ + "dcid": "Place" + }] + }, + "name": { + "nodes": [{ + "value": "B" + }] + } + } + } + } + } + + mock_post.side_effect = cycle_side_effect + + dcids = ["nodeA"] + result = dc.get_place_info(dcids) + + # Should not hang or crash + item = result["data"][0] + parents = item["info"]["parents"] + # nodeA's parents should include nodeB. + self.assertEqual(len(parents), 1) + self.assertEqual(parents[0]["dcid"], "nodeB") + + @patch('server.services.datacommons.post') + def test_get_series_dates_error(self, mock_post): + """Test error handling (e.g. 500 from API).""" + mock_post.side_effect = Exception("API Error") + with self.assertRaises(Exception): + dc.get_series_dates("geoId/06", "County", ["Var1"]) From bcd639258c2cd0e03c1518df6fbb25b4fdc7becc Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 16 Mar 2026 10:17:09 +0530 Subject: [PATCH 06/23] fix: prioritize specific place types over administrative areas --- server/services/datacommons.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index d46c70fb54..4aed5a808d 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -488,7 +488,7 @@ def get_place_info(dcids: List[str]) -> Dict: types_resp = v2node(all_dcids_list, '->typeOf') names_resp = v2node(all_dcids_list, '->name') - def get_first_value(resp, dcid, prop, key='dcid'): + def get_all_values(resp, dcid, prop, key='dcid'): node_data = resp.get('data', {}).get(dcid, {}) arcs_obj = node_data.get('arcs', {}).get(prop, {}) if not arcs_obj: @@ -496,23 +496,37 @@ def get_first_value(resp, dcid, prop, key='dcid'): arcs_obj = node_data.get('arcs', {}).get(prop.replace('->', ''), {}) nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] + return [n.get(key, '') for n in nodes_list if key in n] - if nodes_list: - return nodes_list[0].get(key, '') - return '' + def get_best_type(types_list): + if not types_list: + return '' + + # Sort types by rank (highest rank first) + # If ranks are tied, prefer types that don't start with 'AdministrativeArea' + def sort_key(t): + rank = PLACE_TYPE_RANK.get(t, 0) + is_admin = 1 if t.startswith('AdministrativeArea') else 0 + return (rank, -is_admin) + + return sorted(types_list, key=sort_key, reverse=True)[0] result_data = [] for dcid in dcids: - self_type = get_first_value(types_resp, dcid, 'typeOf') - self_name = get_first_value(names_resp, dcid, 'name', 'value') + self_types = get_all_values(types_resp, dcid, 'typeOf') + self_type = get_best_type(self_types) + self_names = get_all_values(names_resp, dcid, 'name', 'value') + self_name = self_names[0] if self_names else '' parents = [] for anc_dcid in ancestors_map.get(dcid, []): if anc_dcid == dcid: continue - anc_type = get_first_value(types_resp, anc_dcid, 'typeOf') - anc_name = get_first_value(names_resp, anc_dcid, 'name', 'value') + anc_types = get_all_values(types_resp, anc_dcid, 'typeOf') + anc_type = get_best_type(anc_types) + anc_names = get_all_values(names_resp, anc_dcid, 'name', 'value') + anc_name = anc_names[0] if anc_names else '' if anc_type in PLACE_TYPE_RANK: parents.append({ From 5740a9747a62c7bcdacf86ff6378ee3da7e9bf82 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 16 Mar 2026 10:45:15 +0530 Subject: [PATCH 07/23] fix: hardcode United States name for country/USA to match V1 behavior --- server/services/datacommons.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 4aed5a808d..3a2ae073d5 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -516,7 +516,10 @@ def sort_key(t): self_types = get_all_values(types_resp, dcid, 'typeOf') self_type = get_best_type(self_types) self_names = get_all_values(names_resp, dcid, 'name', 'value') - self_name = self_names[0] if self_names else '' + if dcid == 'country/USA': + self_name = 'United States' + else: + self_name = self_names[0] if self_names else '' parents = [] for anc_dcid in ancestors_map.get(dcid, []): @@ -526,7 +529,10 @@ def sort_key(t): anc_types = get_all_values(types_resp, anc_dcid, 'typeOf') anc_type = get_best_type(anc_types) anc_names = get_all_values(names_resp, anc_dcid, 'name', 'value') - anc_name = anc_names[0] if anc_names else '' + if anc_dcid == 'country/USA': + anc_name = 'United States' + else: + anc_name = anc_names[0] if anc_names else '' if anc_type in PLACE_TYPE_RANK: parents.append({ From f768f559b1c1023f381903f61381bd16cb8d3db6 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 16 Mar 2026 11:03:49 +0530 Subject: [PATCH 08/23] style: fix python lint errors using yapf --- server/services/datacommons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 3a2ae073d5..a1eaca42ed 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -501,7 +501,7 @@ def get_all_values(resp, dcid, prop, key='dcid'): def get_best_type(types_list): if not types_list: return '' - + # Sort types by rank (highest rank first) # If ranks are tied, prefer types that don't start with 'AdministrativeArea' def sort_key(t): From 4fb6f36c30a64a0bce2da591d5b02283aef5f81e Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 16 Mar 2026 12:08:09 +0530 Subject: [PATCH 09/23] fix: skip bogus places in get_place_info --- server/services/datacommons.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index a1eaca42ed..04cdf602c2 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -514,8 +514,13 @@ def sort_key(t): result_data = [] for dcid in dcids: self_types = get_all_values(types_resp, dcid, 'typeOf') - self_type = get_best_type(self_types) self_names = get_all_values(names_resp, dcid, 'name', 'value') + + # Skip DCIDs that don't exist in the graph (bogus places) + if not self_types and not self_names: + continue + + self_type = get_best_type(self_types) if dcid == 'country/USA': self_name = 'United States' else: From 8da012e168794a35ff7c0a49b2d7756f0535c23f Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 16 Mar 2026 12:08:40 +0530 Subject: [PATCH 10/23] fix: hardcode New York City name for geoId/3651000 --- server/services/datacommons.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 04cdf602c2..a9b9c24a54 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -523,6 +523,8 @@ def sort_key(t): self_type = get_best_type(self_types) if dcid == 'country/USA': self_name = 'United States' + elif dcid == 'geoId/3651000': + self_name = 'New York City' else: self_name = self_names[0] if self_names else '' @@ -536,6 +538,8 @@ def sort_key(t): anc_names = get_all_values(names_resp, anc_dcid, 'name', 'value') if anc_dcid == 'country/USA': anc_name = 'United States' + elif anc_dcid == 'geoId/3651000': + anc_name = 'New York City' else: anc_name = anc_names[0] if anc_names else '' From 6bb1972244fe39f3f93d93552224386a2ab1a08f Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 16 Mar 2026 12:16:13 +0530 Subject: [PATCH 11/23] fix: use recursive traversal in get_series_dates and update unit tests --- server/services/datacommons.py | 24 +++++------------ server/tests/migration_verification_test.py | 30 +++------------------ 2 files changed, 9 insertions(+), 45 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index a9b9c24a54..f2d4adc898 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -572,33 +572,21 @@ def sort_key(t): def get_series_dates(parent_entity, child_type, variables): """Get series dates.""" - # Get direct children - children_resp = v2node([parent_entity], '<-containedInPlace') + # Get children recursively with type filter + children_resp = v2node([parent_entity], + f'<-containedInPlace+{{typeOf:{child_type}}}') child_dcids = [] node_data = children_resp.get('data', {}).get(parent_entity, {}) - arcs_obj = node_data.get('arcs', {}).get('containedInPlace', {}) + # V2 response key for recursion includes the + but not the filter + arcs_obj = node_data.get('arcs', {}).get('containedInPlace+', {}) nodes_list = arcs_obj.get('nodes', []) if isinstance(arcs_obj, dict) else [] - possible_children = [x['dcid'] for x in nodes_list if 'dcid' in x] - - # Filter by type if there are children - if possible_children: - # Filter children by requested type - type_resp = v2node(possible_children, 'typeOf') - for child in possible_children: - # Check node types - c_data = type_resp.get('data', {}).get(child, {}) - c_arcs = c_data.get('arcs', {}).get('typeOf', {}) - c_types = c_arcs.get('nodes', []) if isinstance(c_arcs, dict) else [] - c_type_ids = [t.get('dcid') for t in c_types] - if child_type in c_type_ids: - child_dcids.append(child) + child_dcids = [x['dcid'] for x in nodes_list if 'dcid' in x] if not child_dcids: return {"datesByVariable": [], "facets": {}} # Get observation dates for the filtered children - obs_resp = v2observation( select=['date', 'variable', 'entity', 'value', 'facet'], entity={'dcids': child_dcids}, diff --git a/server/tests/migration_verification_test.py b/server/tests/migration_verification_test.py index f33d88106c..83b832c1ef 100644 --- a/server/tests/migration_verification_test.py +++ b/server/tests/migration_verification_test.py @@ -119,13 +119,13 @@ def test_get_series_dates_v2(self, mock_post): variables = ["Count_Person"] def side_effect(url, data, api_key=None, log_extreme_calls=False): - # Child nodes - if "<-containedInPlace" in data.get("property", ""): + # Recursive child nodes with type filter + if "<-containedInPlace+{" in data.get("property", ""): return { "data": { "geoId/06": { "arcs": { - "containedInPlace": { + "containedInPlace+": { "nodes": [{ "dcid": "geoId/06001", "name": "Alameda County", @@ -140,30 +140,6 @@ def side_effect(url, data, api_key=None, log_extreme_calls=False): } } } - # Child types - if "typeOf" in data.get("property", ""): - return { - "data": { - "geoId/06001": { - "arcs": { - "typeOf": { - "nodes": [{ - "dcid": "County" - }] - } - } - }, - "geoId/06085": { - "arcs": { - "typeOf": { - "nodes": [{ - "dcid": "County" - }] - } - } - } - } - } # Observations if "variable" in data and "entity" in data: return { From ba425249acfda213525756da2a5f64b7fae4d513 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Mon, 16 Mar 2026 13:41:27 +0530 Subject: [PATCH 12/23] revert: remove New York City hardcoded name --- server/services/datacommons.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index f2d4adc898..630e1e23eb 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -523,8 +523,6 @@ def sort_key(t): self_type = get_best_type(self_types) if dcid == 'country/USA': self_name = 'United States' - elif dcid == 'geoId/3651000': - self_name = 'New York City' else: self_name = self_names[0] if self_names else '' @@ -538,8 +536,6 @@ def sort_key(t): anc_names = get_all_values(names_resp, anc_dcid, 'name', 'value') if anc_dcid == 'country/USA': anc_name = 'United States' - elif anc_dcid == 'geoId/3651000': - anc_name = 'New York City' else: anc_name = anc_names[0] if anc_names else '' From 1029f4484d73be2dbc3164aa8c19e7923f2c8f41 Mon Sep 17 00:00:00 2001 From: datacommons-robot-author Date: Wed, 18 Mar 2026 04:47:09 +0000 Subject: [PATCH 13/23] feat: Update goldens from Cloud Build workflow (build 276e2d55-2442-41f1-80c0-2922463dcc7d) --- .../demo_fallback/query_1/chart_config.json | 4 +- .../debug_info.json | 2 +- .../debug_info.json | 2 +- .../chart_config.json | 90 ++--- .../query_5/chart_config.json | 345 ++++++++++++------ 5 files changed, 284 insertions(+), 159 deletions(-) diff --git a/server/integration_tests/test_data/demo_fallback/query_1/chart_config.json b/server/integration_tests/test_data/demo_fallback/query_1/chart_config.json index 62e9a2ba6c..41339e625e 100644 --- a/server/integration_tests/test_data/demo_fallback/query_1/chart_config.json +++ b/server/integration_tests/test_data/demo_fallback/query_1/chart_config.json @@ -31,7 +31,7 @@ "place": { "dcid": "geoId/0667000", "name": "San Francisco", - "place_type": "City" + "place_type": "AdministrativeArea2" }, "placeFallback": {}, "placeSource": "CURRENT_QUERY", @@ -39,7 +39,7 @@ { "dcid": "geoId/0667000", "name": "San Francisco", - "place_type": "City" + "place_type": "AdministrativeArea2" }, { "dcid": "geoId/1714000", diff --git a/server/integration_tests/test_data/detection_api_bio/whattypesofgenesarefgfr1,apoe,andache/debug_info.json b/server/integration_tests/test_data/detection_api_bio/whattypesofgenesarefgfr1,apoe,andache/debug_info.json index 539f82b410..5b4095c438 100644 --- a/server/integration_tests/test_data/detection_api_bio/whattypesofgenesarefgfr1,apoe,andache/debug_info.json +++ b/server/integration_tests/test_data/detection_api_bio/whattypesofgenesarefgfr1,apoe,andache/debug_info.json @@ -35,7 +35,7 @@ 0.38543, 0.38534, 0.38184, - 0.37971 + 0.3797 ], "MultiSV": {}, "Query": "what types of genes are and", diff --git a/server/integration_tests/test_data/detection_api_multivar/howarefactorslikeobesity,bloodpressureandasthmaimpactedbyclimatechange/debug_info.json b/server/integration_tests/test_data/detection_api_multivar/howarefactorslikeobesity,bloodpressureandasthmaimpactedbyclimatechange/debug_info.json index 2d267671b5..0a137dcdc6 100644 --- a/server/integration_tests/test_data/detection_api_multivar/howarefactorslikeobesity,bloodpressureandasthmaimpactedbyclimatechange/debug_info.json +++ b/server/integration_tests/test_data/detection_api_multivar/howarefactorslikeobesity,bloodpressureandasthmaimpactedbyclimatechange/debug_info.json @@ -32,7 +32,7 @@ 0.63385, 0.63227, 0.63222, - 0.63049, + 0.6305, 0.6303, 0.62984, 0.62957 diff --git a/server/integration_tests/test_data/e2e_date_range/femalepopulationinnewyorkbefore2020/chart_config.json b/server/integration_tests/test_data/e2e_date_range/femalepopulationinnewyorkbefore2020/chart_config.json index 1f6a4f10f2..ed05d7db8d 100644 --- a/server/integration_tests/test_data/e2e_date_range/femalepopulationinnewyorkbefore2020/chart_config.json +++ b/server/integration_tests/test_data/e2e_date_range/femalepopulationinnewyorkbefore2020/chart_config.json @@ -15,7 +15,7 @@ "statVarKey": [ "Count_Person_Female_1145703171" ], - "title": "Women in New York", + "title": "Women in New York City", "type": "LINE" } ] @@ -23,11 +23,11 @@ { "tiles": [ { - "description": "Women in New York", + "description": "Women in New York City", "statVarKey": [ "Count_Person_Female_2019" ], - "title": "Women in New York", + "title": "Women in New York City", "type": "HIGHLIGHT" } ] @@ -49,7 +49,7 @@ "Count_Person_Female_1145703171", "Count_Person_Male_1145703171" ], - "title": "Population by Gender in New York", + "title": "Population by Gender in New York City", "type": "LINE" } ] @@ -69,7 +69,7 @@ "statVarKey": [ "Count_Person_Female_MarriedAndNotSeparated_2369573279" ], - "title": "Non-Separated Married Women in New York", + "title": "Non-Separated Married Women in New York City", "type": "LINE" } ] @@ -77,11 +77,11 @@ { "tiles": [ { - "description": "Non-Separated Married Women in New York", + "description": "Non-Separated Married Women in New York City", "statVarKey": [ "Count_Person_Female_MarriedAndNotSeparated_2019" ], - "title": "Non-Separated Married Women in New York", + "title": "Non-Separated Married Women in New York City", "type": "HIGHLIGHT" } ] @@ -101,7 +101,7 @@ "statVarKey": [ "Count_Person_Female_TwoOrMoreRaces_1145703171" ], - "title": "Women Identifying as Multiracial in New York", + "title": "Women Identifying as Multiracial in New York City", "type": "LINE" } ] @@ -109,11 +109,11 @@ { "tiles": [ { - "description": "Women Identifying as Multiracial in New York", + "description": "Women Identifying as Multiracial in New York City", "statVarKey": [ "Count_Person_Female_TwoOrMoreRaces_2019" ], - "title": "Women Identifying as Multiracial in New York", + "title": "Women Identifying as Multiracial in New York City", "type": "HIGHLIGHT" } ] @@ -133,7 +133,7 @@ "statVarKey": [ "Count_Person_3OrMoreYears_Female_EnrolledInSchool_1145703171" ], - "title": "Population: Female, Enrolled in School in New York", + "title": "Population: Female, Enrolled in School in New York City", "type": "LINE" } ] @@ -141,11 +141,11 @@ { "tiles": [ { - "description": "Population: Female, Enrolled in School in New York", + "description": "Population: Female, Enrolled in School in New York City", "statVarKey": [ "Count_Person_3OrMoreYears_Female_EnrolledInSchool_2019" ], - "title": "Population: Female, Enrolled in School in New York", + "title": "Population: Female, Enrolled in School in New York City", "type": "HIGHLIGHT" } ] @@ -165,7 +165,7 @@ "statVarKey": [ "Count_Person_Female_WithHealthInsurance_1704193675" ], - "title": "Women With Health Insurance in New York", + "title": "Women With Health Insurance in New York City", "type": "LINE" } ] @@ -173,11 +173,11 @@ { "tiles": [ { - "description": "Women With Health Insurance in New York", + "description": "Women With Health Insurance in New York City", "statVarKey": [ "Count_Person_Female_WithHealthInsurance_2019" ], - "title": "Women With Health Insurance in New York", + "title": "Women With Health Insurance in New York City", "type": "HIGHLIGHT" } ] @@ -197,7 +197,7 @@ "statVarKey": [ "Count_Person_Female_FullTimeYearRoundWorker_4208561269" ], - "title": "Population: 16-64 Years, Female, Full Time Year Round Worker in New York", + "title": "Population: 16-64 Years, Female, Full Time Year Round Worker in New York City", "type": "LINE" } ] @@ -205,11 +205,11 @@ { "tiles": [ { - "description": "Population: 16-64 Years, Female, Full Time Year Round Worker in New York", + "description": "Population: 16-64 Years, Female, Full Time Year Round Worker in New York City", "statVarKey": [ "Count_Person_Female_FullTimeYearRoundWorker_2019" ], - "title": "Population: 16-64 Years, Female, Full Time Year Round Worker in New York", + "title": "Population: 16-64 Years, Female, Full Time Year Round Worker in New York City", "type": "HIGHLIGHT" } ] @@ -229,7 +229,7 @@ "statVarKey": [ "Median_Age_Person_Female_3795540742" ], - "title": "Women's Median Age in New York", + "title": "Women's Median Age in New York City", "type": "LINE" } ] @@ -237,11 +237,11 @@ { "tiles": [ { - "description": "Women's Median Age in New York", + "description": "Women's Median Age in New York City", "statVarKey": [ "Median_Age_Person_Female_2019" ], - "title": "Women's Median Age in New York", + "title": "Women's Median Age in New York City", "type": "HIGHLIGHT" } ] @@ -260,7 +260,7 @@ "statVarKey": [ "Count_Person_Female_AsianAlone_1145703171" ], - "title": "Asian Monoracial Women in New York", + "title": "Asian Monoracial Women in New York City", "type": "LINE" } ] @@ -268,11 +268,11 @@ { "tiles": [ { - "description": "Asian Monoracial Women in New York", + "description": "Asian Monoracial Women in New York City", "statVarKey": [ "Count_Person_Female_AsianAlone_2019" ], - "title": "Asian Monoracial Women in New York", + "title": "Asian Monoracial Women in New York City", "type": "HIGHLIGHT" } ] @@ -292,7 +292,7 @@ "statVarKey": [ "Count_Person_Female_WhiteAlone_1145703171" ], - "title": "Women Identifying as White Alone in New York", + "title": "Women Identifying as White Alone in New York City", "type": "LINE" } ] @@ -300,11 +300,11 @@ { "tiles": [ { - "description": "Women Identifying as White Alone in New York", + "description": "Women Identifying as White Alone in New York City", "statVarKey": [ "Count_Person_Female_WhiteAlone_2019" ], - "title": "Women Identifying as White Alone in New York", + "title": "Women Identifying as White Alone in New York City", "type": "HIGHLIGHT" } ] @@ -324,7 +324,7 @@ "statVarKey": [ "Count_Person_25OrMoreYears_EducationalAttainmentBachelorsDegreeOrHigher_Female_1118952551" ], - "title": "Population: Bachelors Degree or Higher, Female in New York", + "title": "Population: Bachelors Degree or Higher, Female in New York City", "type": "LINE" } ] @@ -332,11 +332,11 @@ { "tiles": [ { - "description": "Population: Bachelors Degree or Higher, Female in New York", + "description": "Population: Bachelors Degree or Higher, Female in New York City", "statVarKey": [ "Count_Person_25OrMoreYears_EducationalAttainmentBachelorsDegreeOrHigher_Female_2019" ], - "title": "Population: Bachelors Degree or Higher, Female in New York", + "title": "Population: Bachelors Degree or Higher, Female in New York City", "type": "HIGHLIGHT" } ] @@ -356,7 +356,7 @@ "statVarKey": [ "Count_Person_WithDisability_Female_4281944711" ], - "title": "Women With Disabilities in New York", + "title": "Women With Disabilities in New York City", "type": "LINE" } ] @@ -364,11 +364,11 @@ { "tiles": [ { - "description": "Women With Disabilities in New York", + "description": "Women With Disabilities in New York City", "statVarKey": [ "Count_Person_WithDisability_Female_2019" ], - "title": "Women With Disabilities in New York", + "title": "Women With Disabilities in New York City", "type": "HIGHLIGHT" } ] @@ -388,7 +388,7 @@ "statVarKey": [ "Count_Person_25OrMoreYears_EducationalAttainmentBachelorsDegree_Female_1145703171" ], - "title": "Bachelors, Women in New York", + "title": "Bachelors, Women in New York City", "type": "LINE" } ] @@ -396,11 +396,11 @@ { "tiles": [ { - "description": "Bachelors, Women in New York", + "description": "Bachelors, Women in New York City", "statVarKey": [ "Count_Person_25OrMoreYears_EducationalAttainmentBachelorsDegree_Female_2019" ], - "title": "Bachelors, Women in New York", + "title": "Bachelors, Women in New York City", "type": "HIGHLIGHT" } ] @@ -420,7 +420,7 @@ "statVarKey": [ "Count_Person_16OrMoreYears_Female_WithEarnings_1472009826" ], - "title": "Population: 16 Years or More, Female, With Earnings in New York", + "title": "Population: 16 Years or More, Female, With Earnings in New York City", "type": "LINE" } ] @@ -428,11 +428,11 @@ { "tiles": [ { - "description": "Population: 16 Years or More, Female, With Earnings in New York", + "description": "Population: 16 Years or More, Female, With Earnings in New York City", "statVarKey": [ "Count_Person_16OrMoreYears_Female_WithEarnings_2019" ], - "title": "Population: 16 Years or More, Female, With Earnings in New York", + "title": "Population: 16 Years or More, Female, With Earnings in New York City", "type": "HIGHLIGHT" } ] @@ -452,7 +452,7 @@ "statVarKey": [ "Count_Person_85OrMoreYears_Female_1145703171" ], - "title": "Women Over 85 in New York", + "title": "Women Over 85 in New York City", "type": "LINE" } ] @@ -460,11 +460,11 @@ { "tiles": [ { - "description": "Women Over 85 in New York", + "description": "Women Over 85 in New York City", "statVarKey": [ "Count_Person_85OrMoreYears_Female_2019" ], - "title": "Women Over 85 in New York", + "title": "Women Over 85 in New York City", "type": "HIGHLIGHT" } ] @@ -635,7 +635,7 @@ "pastSourceContext": "", "place": { "dcid": "geoId/3651000", - "name": "New York", + "name": "New York City", "place_type": "City" }, "placeFallback": {}, @@ -643,7 +643,7 @@ "places": [ { "dcid": "geoId/3651000", - "name": "New York", + "name": "New York City", "place_type": "City" } ], diff --git a/server/integration_tests/test_data/place_detection_e2e_dc/query_5/chart_config.json b/server/integration_tests/test_data/place_detection_e2e_dc/query_5/chart_config.json index 7e0a982276..f8fe853316 100644 --- a/server/integration_tests/test_data/place_detection_e2e_dc/query_5/chart_config.json +++ b/server/integration_tests/test_data/place_detection_e2e_dc/query_5/chart_config.json @@ -33,6 +33,27 @@ "description": "The total number of people in a population.", "title": "Population" }, + { + "columns": [ + { + "tiles": [ + { + "rankingTileSpec": { + "rankingCount": 5, + "showHighestLowest": true + }, + "statVarKey": [ + "Count_Person" + ], + "title": "Population in Administrative Area 2 Places of Mexico City (${date})", + "type": "RANKING" + } + ] + } + ], + "description": "The total number of people in a population.", + "title": "Population in Administrative Area 2 Places of Mexico City" + }, { "columns": [ { @@ -145,6 +166,48 @@ "denom": "Count_Person", "title": "Population 85 or Over by Gender" }, + { + "columns": [ + { + "tiles": [ + { + "rankingTileSpec": { + "rankingCount": 5, + "showHighestLowest": true + }, + "statVarKey": [ + "Count_Person_85OrMoreYears_Female" + ], + "title": "Women Over 85 in Administrative Area 2 Places of Mexico City (${date})", + "type": "RANKING" + } + ] + } + ], + "denom": "Count_Person", + "title": "Population 85 or Over by Gender in Administrative Area 2 Places of Mexico City" + }, + { + "columns": [ + { + "tiles": [ + { + "rankingTileSpec": { + "rankingCount": 5, + "showHighestLowest": true + }, + "statVarKey": [ + "Count_Person_85OrMoreYears_Male" + ], + "title": "Men Over 85 in Administrative Area 2 Places of Mexico City (${date})", + "type": "RANKING" + } + ] + } + ], + "denom": "Count_Person", + "title": "Population 85 or Over by Gender in Administrative Area 2 Places of Mexico City" + }, { "columns": [ { @@ -163,6 +226,48 @@ "denom": "Count_Person", "title": "Population by Gender" }, + { + "columns": [ + { + "tiles": [ + { + "rankingTileSpec": { + "rankingCount": 5, + "showHighestLowest": true + }, + "statVarKey": [ + "Count_Person_Female" + ], + "title": "Women in Administrative Area 2 Places of Mexico City (${date})", + "type": "RANKING" + } + ] + } + ], + "denom": "Count_Person", + "title": "Population by Gender in Administrative Area 2 Places of Mexico City" + }, + { + "columns": [ + { + "tiles": [ + { + "rankingTileSpec": { + "rankingCount": 5, + "showHighestLowest": true + }, + "statVarKey": [ + "Count_Person_Male" + ], + "title": "Men in Administrative Area 2 Places of Mexico City (${date})", + "type": "RANKING" + } + ] + } + ], + "denom": "Count_Person", + "title": "Population by Gender in Administrative Area 2 Places of Mexico City" + }, { "columns": [ { @@ -230,10 +335,18 @@ "name": "Population", "statVar": "Count_Person" }, + "Count_Person_85OrMoreYears_Female": { + "name": "Women over 85", + "statVar": "Count_Person_85OrMoreYears_Female" + }, "Count_Person_85OrMoreYears_Female_multiple_place_bar_block": { "name": "Women over 85", "statVar": "Count_Person_85OrMoreYears_Female" }, + "Count_Person_85OrMoreYears_Male": { + "name": "Men over 85", + "statVar": "Count_Person_85OrMoreYears_Male" + }, "Count_Person_85OrMoreYears_Male_multiple_place_bar_block": { "name": "Men over 85", "statVar": "Count_Person_85OrMoreYears_Male" @@ -266,6 +379,9 @@ } ], "metadata": { + "containedPlaceTypes": { + "AdministrativeArea1": "AdministrativeArea2" + }, "placeDcid": [ "wikidataId/Q1489" ] @@ -278,7 +394,7 @@ "place": { "dcid": "wikidataId/Q1489", "name": "Mexico City", - "place_type": "City" + "place_type": "AdministrativeArea1" }, "placeFallback": {}, "placeSource": "CURRENT_QUERY", @@ -286,11 +402,126 @@ { "dcid": "wikidataId/Q1489", "name": "Mexico City", - "place_type": "City" + "place_type": "AdministrativeArea1" } ], "relatedThings": { - "childPlaces": {}, + "childPlaces": { + "AdministrativeArea2": [ + { + "dcid": "wikidataId/Q10832464", + "name": "Venustiano Carranza", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q14906254", + "name": "\u00c1lvaro Obreg\u00f3n", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q1832732", + "name": "Miguel Hidalgo", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q2027082", + "name": "Gustavo A. Madero", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q2356998", + "name": "Benito Ju\u00e1rez de Ochoa Quiroz", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q408181", + "name": "Tl\u00e1huac", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q408187", + "name": "Tlalpan", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q643026", + "name": "Xochimilco", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q645293", + "name": "Cuauht\u00e9moc", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q661315", + "name": "Coyoac\u00e1n", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q741771", + "name": "Iztapalapa", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q762749", + "name": "Cuajimalpa", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q780038", + "name": "La Magdalena Contreras", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q936087", + "name": "Milpa Alta", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q953866", + "name": "Tlalpan", + "types": [ + "AdministrativeArea2" + ] + }, + { + "dcid": "wikidataId/Q994867", + "name": "Azcapotzalco", + "types": [ + "AdministrativeArea2" + ] + } + ] + }, "childTopics": [ { "dcid": "dc/topic/Age", @@ -347,113 +578,7 @@ ] } ], - "peerPlaces": [ - { - "dcid": "wikidataId/Q956", - "name": "Beijing", - "types": [ - "AdministrativeArea1" - ] - }, - { - "dcid": "nuts/DE3", - "name": "Berlin", - "types": [ - "AdministrativeArea1" - ] - }, - { - "dcid": "wikidataId/Q85", - "name": "Cairo", - "types": [ - "City" - ] - }, - { - "dcid": "geoId/1714000", - "name": "Chicago", - "types": [ - "City" - ] - }, - { - "dcid": "wikidataId/Q1353", - "name": "Delhi", - "types": [ - "AdministrativeArea1" - ] - }, - { - "dcid": "wikidataId/Q34647", - "name": "Johannesburg", - "types": [ - "City" - ] - }, - { - "dcid": "wikidataId/Q84", - "name": "London", - "types": [ - "City" - ] - }, - { - "dcid": "wikidataId/Q2807", - "name": "Madrid", - "types": [ - "AdministrativeArea3" - ] - }, - { - "dcid": "wikidataId/Q649", - "name": "Moscow", - "types": [ - "AdministrativeArea1" - ] - }, - { - "dcid": "geoId/3651000", - "name": "New York", - "types": [ - "City" - ] - }, - { - "dcid": "nuts/FR101", - "name": "Paris", - "types": [ - "AdministrativeArea2" - ] - }, - { - "dcid": "wikidataId/Q8678", - "name": "Rio de Janeiro", - "types": [ - "AdministrativeArea2" - ] - }, - { - "dcid": "geoId/0667000", - "name": "San Francisco", - "types": [ - "AdministrativeArea2" - ] - }, - { - "dcid": "wikidataId/Q3130", - "name": "Sydney", - "types": [ - "City" - ] - }, - { - "dcid": "wikidataId/Q7473516", - "name": "Tokyo", - "types": [ - "City" - ] - } - ], + "peerPlaces": [], "peerTopics": [ { "dcid": "dc/topic/Health", From 1665c9ced7bb4afb9e59288af312b7dde09d04f0 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 11:23:51 +0530 Subject: [PATCH 14/23] refactor: Remove hardcoded name override for country/USA --- server/services/datacommons.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index f63dace13c..f1a87e2289 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -436,7 +436,8 @@ def get_place_info(dcids: List[str]) -> Dict: visited = set() # BFS to build parent graph (max depth 10) - for _ in range(10): + MAX_ANCESTOR_DEPTH = 10 + for _ in range(MAX_ANCESTOR_DEPTH): if not frontier: break @@ -524,10 +525,7 @@ def sort_key(t): continue self_type = get_best_type(self_types) - if dcid == 'country/USA': - self_name = 'United States' - else: - self_name = self_names[0] if self_names else '' + self_name = self_names[0] if self_names else '' parents = [] for anc_dcid in ancestors_map.get(dcid, []): @@ -537,10 +535,7 @@ def sort_key(t): anc_types = get_all_values(types_resp, anc_dcid, 'typeOf') anc_type = get_best_type(anc_types) anc_names = get_all_values(names_resp, anc_dcid, 'name', 'value') - if anc_dcid == 'country/USA': - anc_name = 'United States' - else: - anc_name = anc_names[0] if anc_names else '' + anc_name = anc_names[0] if anc_names else '' if anc_type in PLACE_TYPE_RANK: parents.append({ From 9804dfd4e39a74286fcaa44f17b7ea1431c71645 Mon Sep 17 00:00:00 2001 From: datacommons-robot-author Date: Wed, 18 Mar 2026 06:06:04 +0000 Subject: [PATCH 15/23] feat: Update goldens from Cloud Build workflow (build 89397212-0490-4b54-9d0c-4c13795f46b5) --- .../demo_fallback/query_5/chart_config.json | 104 +++++------ .../demo_feb2023/query_8/chart_config.json | 28 +-- .../demo_feb2023/query_9/chart_config.json | 38 ++-- .../debug_info.json | 2 +- .../debug_info.json | 2 +- .../chart_config.json | 74 ++++---- .../chart_config.json | 72 ++++---- .../chart_config.json | 4 +- .../chart_config.json | 128 +++++++------- .../chart_config.json | 38 ++-- .../chart_config.json | 146 +++++++-------- .../chart_config.json | 46 ++--- .../chart_config.json | 4 +- .../chart_config.json | 58 +++--- .../chart_config.json | 34 ++-- .../chart_config.json | 34 ++-- .../chart_config.json | 34 ++-- .../query_2/chart_config.json | 68 +++---- .../query_2/debug_info.json | 4 +- .../query_6/chart_config.json | 166 +++++++++--------- .../query_6/debug_info.json | 4 +- 21 files changed, 544 insertions(+), 544 deletions(-) diff --git a/server/integration_tests/test_data/demo_fallback/query_5/chart_config.json b/server/integration_tests/test_data/demo_fallback/query_5/chart_config.json index 7fcd2e853e..1af9c1aa3a 100644 --- a/server/integration_tests/test_data/demo_fallback/query_5/chart_config.json +++ b/server/integration_tests/test_data/demo_fallback/query_5/chart_config.json @@ -12,7 +12,7 @@ "statVarKey": [ "Amount_EconomicActivity_GrossDomesticProduction_Nominal" ], - "title": "GDP (Nominal Value) in United States", + "title": "GDP (Nominal Value) in United States of America", "type": "LINE" } ] @@ -20,11 +20,11 @@ { "tiles": [ { - "description": "GDP (Nominal Value) in United States", + "description": "GDP (Nominal Value) in United States of America", "statVarKey": [ "Amount_EconomicActivity_GrossDomesticProduction_Nominal" ], - "title": "GDP (Nominal Value) in United States", + "title": "GDP (Nominal Value) in United States of America", "type": "HIGHLIGHT" } ] @@ -42,7 +42,7 @@ "statVarKey": [ "Amount_EconomicActivity_GrossDomesticProduction_Nominal_PerCapita" ], - "title": "Nominal GDP Per Capita in United States", + "title": "Nominal GDP Per Capita in United States of America", "type": "LINE" } ] @@ -50,11 +50,11 @@ { "tiles": [ { - "description": "Nominal GDP Per Capita in United States", + "description": "Nominal GDP Per Capita in United States of America", "statVarKey": [ "Amount_EconomicActivity_GrossDomesticProduction_Nominal_PerCapita" ], - "title": "Nominal GDP Per Capita in United States", + "title": "Nominal GDP Per Capita in United States of America", "type": "HIGHLIGHT" } ] @@ -71,7 +71,7 @@ "statVarKey": [ "Amount_EconomicActivity_GrossDomesticProduction_RealValue" ], - "title": "GDP (Real Value) in United States", + "title": "GDP (Real Value) in United States of America", "type": "LINE" } ] @@ -79,11 +79,11 @@ { "tiles": [ { - "description": "GDP (Real Value) in United States", + "description": "GDP (Real Value) in United States of America", "statVarKey": [ "Amount_EconomicActivity_GrossDomesticProduction_RealValue" ], - "title": "GDP (Real Value) in United States", + "title": "GDP (Real Value) in United States of America", "type": "HIGHLIGHT" } ] @@ -101,7 +101,7 @@ "statVarKey": [ "GrowthRate_Amount_EconomicActivity_GrossDomesticProduction" ], - "title": "Growth Rate of GDP in United States", + "title": "Growth Rate of GDP in United States of America", "type": "LINE" } ] @@ -109,11 +109,11 @@ { "tiles": [ { - "description": "Growth Rate of GDP in United States", + "description": "Growth Rate of GDP in United States of America", "statVarKey": [ "GrowthRate_Amount_EconomicActivity_GrossDomesticProduction" ], - "title": "Growth Rate of GDP in United States", + "title": "Growth Rate of GDP in United States of America", "type": "HIGHLIGHT" } ] @@ -155,7 +155,7 @@ "dc/qt7ewllmt3826_multiple_place_bar_block", "dc/zz6gwv838v9w_multiple_place_bar_block" ], - "title": "Breakdown of Real GDP by Industry in United States (${date})", + "title": "Breakdown of Real GDP by Industry in United States of America (${date})", "type": "BAR" } ] @@ -200,7 +200,7 @@ "Count_Establishment_NAICSPublicAdministration_multiple_place_bar_block", "Count_Establishment_NAICSNonclassifiable_multiple_place_bar_block" ], - "title": "Number of Establishments by Industry in United States (${date})", + "title": "Number of Establishments by Industry in United States of America (${date})", "type": "BAR" } ] @@ -220,7 +220,7 @@ "Count_Establishment_PrivatelyOwnedEstablishment_NAICSTotalAllIndustries", "Count_Establishment_StateGovernmentOwnedEstablishment_NAICSTotalAllIndustries" ], - "title": "Number of Establishments by Ownership Type in United States", + "title": "Number of Establishments by Ownership Type in United States of America", "type": "LINE" } ] @@ -282,7 +282,7 @@ "dc/sz9ckd47e35b4_multiple_place_bar_block", "dc/zkmdz1rhlt7q8_multiple_place_bar_block" ], - "title": "Revenue by Industry Type in United States (${date})", + "title": "Revenue by Industry Type in United States of America (${date})", "type": "BAR" } ] @@ -299,7 +299,7 @@ "statVarKey": [ "Count_Person_Employed" ], - "title": "Population With Current Employment in United States", + "title": "Population With Current Employment in United States of America", "type": "LINE" } ] @@ -307,11 +307,11 @@ { "tiles": [ { - "description": "Population With Current Employment in United States", + "description": "Population With Current Employment in United States of America", "statVarKey": [ "Count_Person_Employed" ], - "title": "Population With Current Employment in United States", + "title": "Population With Current Employment in United States of America", "type": "HIGHLIGHT" } ] @@ -356,7 +356,7 @@ "Count_Worker_NAICSManagementOfCompaniesEnterprises_multiple_place_bar_block", "Count_Worker_NAICSNonclassifiable_multiple_place_bar_block" ], - "title": "Categories of Jobs in United States (${date})", + "title": "Categories of Jobs in United States of America (${date})", "type": "BAR" } ] @@ -373,7 +373,7 @@ "statVarKey": [ "Median_Income_Household" ], - "title": "Household Median Income in United States", + "title": "Household Median Income in United States of America", "type": "LINE" } ] @@ -381,11 +381,11 @@ { "tiles": [ { - "description": "Household Median Income in United States", + "description": "Household Median Income in United States of America", "statVarKey": [ "Median_Income_Household" ], - "title": "Household Median Income in United States", + "title": "Household Median Income in United States of America", "type": "HIGHLIGHT" } ] @@ -401,7 +401,7 @@ "statVarKey": [ "Median_Income_Person" ], - "title": "Individual Median Income in United States", + "title": "Individual Median Income in United States of America", "type": "LINE" } ] @@ -409,11 +409,11 @@ { "tiles": [ { - "description": "Individual Median Income in United States", + "description": "Individual Median Income in United States of America", "statVarKey": [ "Median_Income_Person" ], - "title": "Individual Median Income in United States", + "title": "Individual Median Income in United States of America", "type": "HIGHLIGHT" } ] @@ -429,7 +429,7 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months" ], - "title": "Population Below Poverty Line in United States", + "title": "Population Below Poverty Line in United States of America", "type": "LINE" } ] @@ -437,11 +437,11 @@ { "tiles": [ { - "description": "Population Below Poverty Line in United States", + "description": "Population Below Poverty Line in United States of America", "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months" ], - "title": "Population Below Poverty Line in United States", + "title": "Population Below Poverty Line in United States of America", "type": "HIGHLIGHT" } ] @@ -459,7 +459,7 @@ "Count_Person_Female_BelowPovertyLevelInThePast12Months", "Count_Person_Male_BelowPovertyLevelInThePast12Months" ], - "title": "Impoverished Population by Gender in United States", + "title": "Impoverished Population by Gender in United States of America", "type": "LINE" } ] @@ -491,7 +491,7 @@ "Count_Person_BelowPovertyLevelInThePast12Months_WhiteAlone_multiple_place_bar_block", "Count_Person_BelowPovertyLevelInThePast12Months_WhiteAloneNotHispanicOrLatino_multiple_place_bar_block" ], - "title": "Impoverished Population by Race in United States (${date})", + "title": "Impoverished Population by Race in United States of America (${date})", "type": "BAR" } ] @@ -508,7 +508,7 @@ "statVarKey": [ "Area_Farm" ], - "title": "Total Farm Area in United States", + "title": "Total Farm Area in United States of America", "type": "LINE" } ] @@ -516,11 +516,11 @@ { "tiles": [ { - "description": "Total Farm Area in United States", + "description": "Total Farm Area in United States of America", "statVarKey": [ "Area_Farm" ], - "title": "Total Farm Area in United States", + "title": "Total Farm Area in United States of America", "type": "HIGHLIGHT" } ] @@ -536,7 +536,7 @@ "statVarKey": [ "Count_Farm" ], - "title": "Farms in United States", + "title": "Farms in United States of America", "type": "LINE" } ] @@ -544,11 +544,11 @@ { "tiles": [ { - "description": "Farms in United States", + "description": "Farms in United States of America", "statVarKey": [ "Count_Farm" ], - "title": "Farms in United States", + "title": "Farms in United States of America", "type": "HIGHLIGHT" } ] @@ -565,7 +565,7 @@ "statVarKey": [ "Income_Farm" ], - "title": "Total Farm Income in United States", + "title": "Total Farm Income in United States of America", "type": "LINE" } ] @@ -573,11 +573,11 @@ { "tiles": [ { - "description": "Total Farm Income in United States", + "description": "Total Farm Income in United States of America", "statVarKey": [ "Income_Farm" ], - "title": "Total Farm Income in United States", + "title": "Total Farm Income in United States of America", "type": "HIGHLIGHT" } ] @@ -594,7 +594,7 @@ "statVarKey": [ "Count_Worker_NAICSAgricultureForestryFishingHunting" ], - "title": "Agriculture, Forestry, Fishing, Hunting Workers in United States", + "title": "Agriculture, Forestry, Fishing, Hunting Workers in United States of America", "type": "LINE" } ] @@ -602,11 +602,11 @@ { "tiles": [ { - "description": "Agriculture, Forestry, Fishing, Hunting Workers in United States", + "description": "Agriculture, Forestry, Fishing, Hunting Workers in United States of America", "statVarKey": [ "Count_Worker_NAICSAgricultureForestryFishingHunting" ], - "title": "Agriculture, Forestry, Fishing, Hunting Workers in United States", + "title": "Agriculture, Forestry, Fishing, Hunting Workers in United States of America", "type": "HIGHLIGHT" } ] @@ -623,7 +623,7 @@ "statVarKey": [ "Adjusted_GrowthRate_GrossDomesticProduct_EconomicActivity_QuarterOnChange" ], - "title": "Adjusted GDP Growth Rate (Quarter-over-Quarter) in United States", + "title": "Adjusted GDP Growth Rate (Quarter-over-Quarter) in United States of America", "type": "LINE" } ] @@ -631,11 +631,11 @@ { "tiles": [ { - "description": "Adjusted GDP Growth Rate (Quarter-over-Quarter) in United States", + "description": "Adjusted GDP Growth Rate (Quarter-over-Quarter) in United States of America", "statVarKey": [ "Adjusted_GrowthRate_GrossDomesticProduct_EconomicActivity_QuarterOnChange" ], - "title": "Adjusted GDP Growth Rate (Quarter-over-Quarter) in United States", + "title": "Adjusted GDP Growth Rate (Quarter-over-Quarter) in United States of America", "type": "HIGHLIGHT" } ] @@ -651,7 +651,7 @@ "statVarKey": [ "sdg/EN_MAT_DOMCMPG" ], - "title": "Domestic Material Consumption Per Unit of GDP in United States", + "title": "Domestic Material Consumption Per Unit of GDP in United States of America", "type": "LINE" } ] @@ -659,11 +659,11 @@ { "tiles": [ { - "description": "Domestic Material Consumption Per Unit of GDP in United States", + "description": "Domestic Material Consumption Per Unit of GDP in United States of America", "statVarKey": [ "sdg/EN_MAT_DOMCMPG" ], - "title": "Domestic Material Consumption Per Unit of GDP in United States", + "title": "Domestic Material Consumption Per Unit of GDP in United States of America", "type": "HIGHLIGHT" } ] @@ -703,7 +703,7 @@ "Amount_EconomicActivity_GrossDomesticProduction_NAICSUtilities_RealValue_multiple_place_bar_block", "Amount_EconomicActivity_GrossDomesticProduction_NAICSWholesaleTrade_RealValue_multiple_place_bar_block" ], - "title": "GDP of the Construction Industry and More in United States (${date})", + "title": "GDP of the Construction Industry and More in United States of America (${date})", "type": "BAR" } ] @@ -1233,7 +1233,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -1241,7 +1241,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/demo_feb2023/query_8/chart_config.json b/server/integration_tests/test_data/demo_feb2023/query_8/chart_config.json index 7355cc4c8b..8c6e21db2b 100644 --- a/server/integration_tests/test_data/demo_feb2023/query_8/chart_config.json +++ b/server/integration_tests/test_data/demo_feb2023/query_8/chart_config.json @@ -16,7 +16,7 @@ "statVarKey": [ "Percent_Person_WithHighBloodPressure" ], - "title": "High Blood Pressure in Counties of United States (${date})", + "title": "High Blood Pressure in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -27,13 +27,13 @@ "statVarKey": [ "Percent_Person_WithHighBloodPressure" ], - "title": "High Blood Pressure in Counties of United States (${date})", + "title": "High Blood Pressure in Counties of United States of America (${date})", "type": "MAP" } ] } ], - "title": "High Blood Pressure in Counties of United States" + "title": "High Blood Pressure in Counties of United States of America" }, { "columns": [ @@ -43,7 +43,7 @@ "statVarKey": [ "Percent_Person_WithHighBloodPressure" ], - "title": "High Blood Pressure in United States", + "title": "High Blood Pressure in United States of America", "type": "LINE" } ] @@ -51,11 +51,11 @@ { "tiles": [ { - "description": "High Blood Pressure in United States", + "description": "High Blood Pressure in United States of America", "statVarKey": [ "Percent_Person_WithHighBloodPressure" ], - "title": "High Blood Pressure in United States", + "title": "High Blood Pressure in United States of America", "type": "HIGHLIGHT" } ] @@ -75,7 +75,7 @@ "statVarKey": [ "Percent_Person_18OrMoreYears_WithHighBloodPressure_ReceivedTakingBloodPressureMedication" ], - "title": "Percent of Adults With Blood Pressure Who Take Medication in Counties of United States (${date})", + "title": "Percent of Adults With Blood Pressure Who Take Medication in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -86,13 +86,13 @@ "statVarKey": [ "Percent_Person_18OrMoreYears_WithHighBloodPressure_ReceivedTakingBloodPressureMedication" ], - "title": "Percent of Adults With Blood Pressure Who Take Medication in Counties of United States (${date})", + "title": "Percent of Adults With Blood Pressure Who Take Medication in Counties of United States of America (${date})", "type": "MAP" } ] } ], - "title": "Percent of Adults With Blood Pressure Who Take Medication in Counties of United States" + "title": "Percent of Adults With Blood Pressure Who Take Medication in Counties of United States of America" }, { "columns": [ @@ -102,7 +102,7 @@ "statVarKey": [ "Percent_Person_18OrMoreYears_WithHighBloodPressure_ReceivedTakingBloodPressureMedication" ], - "title": "Percent of Adults With Blood Pressure Who Take Medication in United States", + "title": "Percent of Adults With Blood Pressure Who Take Medication in United States of America", "type": "LINE" } ] @@ -110,11 +110,11 @@ { "tiles": [ { - "description": "Percent of Adults With Blood Pressure Who Take Medication in United States", + "description": "Percent of Adults With Blood Pressure Who Take Medication in United States of America", "statVarKey": [ "Percent_Person_18OrMoreYears_WithHighBloodPressure_ReceivedTakingBloodPressureMedication" ], - "title": "Percent of Adults With Blood Pressure Who Take Medication in United States", + "title": "Percent of Adults With Blood Pressure Who Take Medication in United States of America", "type": "HIGHLIGHT" } ] @@ -152,7 +152,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -160,7 +160,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/demo_feb2023/query_9/chart_config.json b/server/integration_tests/test_data/demo_feb2023/query_9/chart_config.json index 3ad42c33a9..ea56e34ab6 100644 --- a/server/integration_tests/test_data/demo_feb2023/query_9/chart_config.json +++ b/server/integration_tests/test_data/demo_feb2023/query_9/chart_config.json @@ -16,7 +16,7 @@ "Median_Income_Household_scatter", "Percent_Person_WithHighBloodPressure_scatter" ], - "title": "Household Median Income (${yDate}) Vs. High Blood Pressure (${xDate}) in States of United States", + "title": "Household Median Income (${yDate}) Vs. High Blood Pressure (${xDate}) in States of United States of America", "type": "SCATTER" } ] @@ -32,7 +32,7 @@ "statVarKey": [ "Median_Income_Household" ], - "title": "Household Median Income in States of United States (${date})", + "title": "Household Median Income in States of United States of America (${date})", "type": "MAP" } ] @@ -47,13 +47,13 @@ "statVarKey": [ "Median_Income_Household" ], - "title": "Household Median Income in States of United States (${date})", + "title": "Household Median Income in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Household Median Income in States of United States" + "title": "Household Median Income in States of United States of America" }, { "columns": [ @@ -63,7 +63,7 @@ "statVarKey": [ "Percent_Person_WithHighBloodPressure" ], - "title": "High Blood Pressure in States of United States (${date})", + "title": "High Blood Pressure in States of United States of America (${date})", "type": "MAP" } ] @@ -78,13 +78,13 @@ "statVarKey": [ "Percent_Person_WithHighBloodPressure" ], - "title": "High Blood Pressure in States of United States (${date})", + "title": "High Blood Pressure in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "High Blood Pressure in States of United States" + "title": "High Blood Pressure in States of United States of America" }, { "columns": [ @@ -98,7 +98,7 @@ "Median_Income_Person_scatter", "Percent_Person_18OrMoreYears_WithHighBloodPressure_ReceivedTakingBloodPressureMedication_scatter" ], - "title": "Individual Median Income (${yDate}) Vs. Percent of Adults With Blood Pressure Who Take Medication (${xDate}) in States of United States", + "title": "Individual Median Income (${yDate}) Vs. Percent of Adults With Blood Pressure Who Take Medication (${xDate}) in States of United States of America", "type": "SCATTER" } ] @@ -114,7 +114,7 @@ "statVarKey": [ "Median_Income_Person" ], - "title": "Individual Median Income in States of United States (${date})", + "title": "Individual Median Income in States of United States of America (${date})", "type": "MAP" } ] @@ -129,13 +129,13 @@ "statVarKey": [ "Median_Income_Person" ], - "title": "Individual Median Income in States of United States (${date})", + "title": "Individual Median Income in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Individual Median Income in States of United States" + "title": "Individual Median Income in States of United States of America" }, { "columns": [ @@ -145,7 +145,7 @@ "statVarKey": [ "Percent_Person_18OrMoreYears_WithHighBloodPressure_ReceivedTakingBloodPressureMedication" ], - "title": "Percent of Adults With Blood Pressure Who Take Medication in States of United States (${date})", + "title": "Percent of Adults With Blood Pressure Who Take Medication in States of United States of America (${date})", "type": "MAP" } ] @@ -160,13 +160,13 @@ "statVarKey": [ "Percent_Person_18OrMoreYears_WithHighBloodPressure_ReceivedTakingBloodPressureMedication" ], - "title": "Percent of Adults With Blood Pressure Who Take Medication in States of United States (${date})", + "title": "Percent of Adults With Blood Pressure Who Take Medication in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Percent of Adults With Blood Pressure Who Take Medication in States of United States" + "title": "Percent of Adults With Blood Pressure Who Take Medication in States of United States of America" }, { "columns": [ @@ -180,7 +180,7 @@ "Median_Income_Household_scatter", "Percent_Person_18OrMoreYears_WithHighBloodPressure_ReceivedTakingBloodPressureMedication_scatter" ], - "title": "Household Median Income (${yDate}) Vs. Percent of Adults With Blood Pressure Who Take Medication (${xDate}) in States of United States", + "title": "Household Median Income (${yDate}) Vs. Percent of Adults With Blood Pressure Who Take Medication (${xDate}) in States of United States of America", "type": "SCATTER" } ] @@ -200,7 +200,7 @@ "Median_Income_Person_scatter", "Percent_Person_WithHighBloodPressure_scatter" ], - "title": "Individual Median Income (${yDate}) Vs. High Blood Pressure (${xDate}) in States of United States", + "title": "Individual Median Income (${yDate}) Vs. High Blood Pressure (${xDate}) in States of United States of America", "type": "SCATTER" } ] @@ -265,10 +265,10 @@ "context": {}, "debug": {}, "entities": [], - "pastSourceContext": "United States", + "pastSourceContext": "United States of America", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -276,7 +276,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/detection_api_bio/whattypesofgenesarefgfr1,apoe,andache/debug_info.json b/server/integration_tests/test_data/detection_api_bio/whattypesofgenesarefgfr1,apoe,andache/debug_info.json index 5b4095c438..539f82b410 100644 --- a/server/integration_tests/test_data/detection_api_bio/whattypesofgenesarefgfr1,apoe,andache/debug_info.json +++ b/server/integration_tests/test_data/detection_api_bio/whattypesofgenesarefgfr1,apoe,andache/debug_info.json @@ -35,7 +35,7 @@ 0.38543, 0.38534, 0.38184, - 0.3797 + 0.37971 ], "MultiSV": {}, "Query": "what types of genes are and", diff --git a/server/integration_tests/test_data/detection_api_multivar/howarefactorslikeobesity,bloodpressureandasthmaimpactedbyclimatechange/debug_info.json b/server/integration_tests/test_data/detection_api_multivar/howarefactorslikeobesity,bloodpressureandasthmaimpactedbyclimatechange/debug_info.json index 0a137dcdc6..2d267671b5 100644 --- a/server/integration_tests/test_data/detection_api_multivar/howarefactorslikeobesity,bloodpressureandasthmaimpactedbyclimatechange/debug_info.json +++ b/server/integration_tests/test_data/detection_api_multivar/howarefactorslikeobesity,bloodpressureandasthmaimpactedbyclimatechange/debug_info.json @@ -32,7 +32,7 @@ 0.63385, 0.63227, 0.63222, - 0.6305, + 0.63049, 0.6303, 0.62984, 0.62957 diff --git a/server/integration_tests/test_data/e2e_date_range/lifeexpectancyinusstatesinthelast5years/chart_config.json b/server/integration_tests/test_data/e2e_date_range/lifeexpectancyinusstatesinthelast5years/chart_config.json index 67c5fa068b..24f987918b 100644 --- a/server/integration_tests/test_data/e2e_date_range/lifeexpectancyinusstatesinthelast5years/chart_config.json +++ b/server/integration_tests/test_data/e2e_date_range/lifeexpectancyinusstatesinthelast5years/chart_config.json @@ -15,7 +15,7 @@ "statVarKey": [ "LifeExpectancy_Person_3563600999" ], - "title": "Life Expectancy in United States", + "title": "Life Expectancy in United States of America", "type": "LINE" } ] @@ -23,11 +23,11 @@ { "tiles": [ { - "description": "Life Expectancy in United States", + "description": "Life Expectancy in United States of America", "statVarKey": [ "LifeExpectancy_Person" ], - "title": "Life Expectancy in United States", + "title": "Life Expectancy in United States of America", "type": "HIGHLIGHT" } ] @@ -47,7 +47,7 @@ "LifeExpectancy_Person_Female_2776657033", "LifeExpectancy_Person_Male_2776657033" ], - "title": "Life Expectancy by Gender in United States", + "title": "Life Expectancy by Gender in United States of America", "type": "LINE" } ] @@ -63,7 +63,7 @@ "statVarKey": [ "Count_Death" ], - "title": "Number of Deaths in States of United States (${date})", + "title": "Number of Deaths in States of United States of America (${date})", "type": "MAP" } ] @@ -78,14 +78,14 @@ "statVarKey": [ "Count_Death" ], - "title": "Number of Deaths in States of United States (${date})", + "title": "Number of Deaths in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Number of Deaths in States of United States" + "title": "Number of Deaths in States of United States of America" }, { "columns": [ @@ -98,7 +98,7 @@ "statVarKey": [ "Count_Death_1662700527" ], - "title": "Number of Deaths in United States", + "title": "Number of Deaths in United States of America", "type": "LINE" } ] @@ -106,11 +106,11 @@ { "tiles": [ { - "description": "Number of Deaths in United States", + "description": "Number of Deaths in United States of America", "statVarKey": [ "Count_Death" ], - "title": "Number of Deaths in United States", + "title": "Number of Deaths in United States of America", "type": "HIGHLIGHT" } ] @@ -130,7 +130,7 @@ "statVarKey": [ "Count_Death_AsAFractionOfCount_Person_1113810078" ], - "title": "Deaths Per Capita in United States", + "title": "Deaths Per Capita in United States of America", "type": "LINE" } ] @@ -138,11 +138,11 @@ { "tiles": [ { - "description": "Deaths Per Capita in United States", + "description": "Deaths Per Capita in United States of America", "statVarKey": [ "Count_Death_AsAFractionOfCount_Person" ], - "title": "Deaths Per Capita in United States", + "title": "Deaths Per Capita in United States of America", "type": "HIGHLIGHT" } ] @@ -161,7 +161,7 @@ "statVarKey": [ "Count_Death_IntentionalSelfHarm_AsFractionOf_Count_Person_448542840" ], - "title": "Suicide Mortality Rate in United States", + "title": "Suicide Mortality Rate in United States of America", "type": "LINE" } ] @@ -169,11 +169,11 @@ { "tiles": [ { - "description": "Suicide Mortality Rate in United States", + "description": "Suicide Mortality Rate in United States of America", "statVarKey": [ "Count_Death_IntentionalSelfHarm_AsFractionOf_Count_Person" ], - "title": "Suicide Mortality Rate in United States", + "title": "Suicide Mortality Rate in United States of America", "type": "HIGHLIGHT" } ] @@ -192,7 +192,7 @@ "statVarKey": [ "sdg/SH_DYN_NMRT.AGE--M0_2966989201" ], - "title": "Neonatal Mortality Rate in United States", + "title": "Neonatal Mortality Rate in United States of America", "type": "LINE" } ] @@ -200,11 +200,11 @@ { "tiles": [ { - "description": "Neonatal Mortality Rate in United States", + "description": "Neonatal Mortality Rate in United States of America", "statVarKey": [ "sdg/SH_DYN_NMRT.AGE--M0" ], - "title": "Neonatal Mortality Rate in United States", + "title": "Neonatal Mortality Rate in United States of America", "type": "HIGHLIGHT" } ] @@ -224,7 +224,7 @@ "statVarKey": [ "Count_Death_Upto1Years_1662700527" ], - "title": "Count of Mortality Event: 1 Years or Less in United States", + "title": "Count of Mortality Event: 1 Years or Less in United States of America", "type": "LINE" } ] @@ -232,11 +232,11 @@ { "tiles": [ { - "description": "Count of Mortality Event: 1 Years or Less in United States", + "description": "Count of Mortality Event: 1 Years or Less in United States of America", "statVarKey": [ "Count_Death_Upto1Years" ], - "title": "Count of Mortality Event: 1 Years or Less in United States", + "title": "Count of Mortality Event: 1 Years or Less in United States of America", "type": "HIGHLIGHT" } ] @@ -257,7 +257,7 @@ "sdg/SH_DYN_IMRT.AGE--Y0__SEX--F_2966989201", "sdg/SH_DYN_IMRT.AGE--Y0__SEX--M_2966989201" ], - "title": "Infant Mortality Rate by Gender in United States", + "title": "Infant Mortality Rate by Gender in United States of America", "type": "LINE" } ] @@ -273,7 +273,7 @@ "statVarKey": [ "Mean_IntervalSinceLastBirth_BirthEvent_LiveBirth" ], - "title": "Average Interval in Months Since Last Live Birth in States of United States (${date})", + "title": "Average Interval in Months Since Last Live Birth in States of United States of America (${date})", "type": "MAP" } ] @@ -288,13 +288,13 @@ "statVarKey": [ "Mean_IntervalSinceLastBirth_BirthEvent_LiveBirth" ], - "title": "Average Interval in Months Since Last Live Birth in States of United States (${date})", + "title": "Average Interval in Months Since Last Live Birth in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Average Interval in Months Since Last Live Birth in States of United States" + "title": "Average Interval in Months Since Last Live Birth in States of United States of America" }, { "columns": [ @@ -307,7 +307,7 @@ "statVarKey": [ "Count_Death_0Years_AsFractionOf_Count_BirthEvent_LiveBirth_606064963" ], - "title": "Infant Mortality Rate in United States", + "title": "Infant Mortality Rate in United States of America", "type": "LINE" } ] @@ -315,11 +315,11 @@ { "tiles": [ { - "description": "Infant Mortality Rate in United States", + "description": "Infant Mortality Rate in United States of America", "statVarKey": [ "Count_Death_0Years_AsFractionOf_Count_BirthEvent_LiveBirth" ], - "title": "Infant Mortality Rate in United States", + "title": "Infant Mortality Rate in United States of America", "type": "HIGHLIGHT" } ] @@ -336,7 +336,7 @@ "statVarKey": [ "Median_Age_Person" ], - "title": "Median Age of Population in States of United States (${date})", + "title": "Median Age of Population in States of United States of America (${date})", "type": "MAP" } ] @@ -351,14 +351,14 @@ "statVarKey": [ "Median_Age_Person" ], - "title": "Median Age of Population in States of United States (${date})", + "title": "Median Age of Population in States of United States of America (${date})", "type": "RANKING" } ] } ], "description": "The median age of people in a population.", - "title": "Median Age of Population in States of United States" + "title": "Median Age of Population in States of United States of America" }, { "columns": [ @@ -371,7 +371,7 @@ "statVarKey": [ "Median_Age_Person_3795540742" ], - "title": "Median Age of Population in United States", + "title": "Median Age of Population in United States of America", "type": "LINE" } ] @@ -379,11 +379,11 @@ { "tiles": [ { - "description": "Median Age of Population in United States", + "description": "Median Age of Population in United States of America", "statVarKey": [ "Median_Age_Person" ], - "title": "Median Age of Population in United States", + "title": "Median Age of Population in United States of America", "type": "HIGHLIGHT" } ] @@ -508,7 +508,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -516,7 +516,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/e2e_edge_cases2/whatcrimesareconsideredfeloniesvs.misdemeanorsintheus/chart_config.json b/server/integration_tests/test_data/e2e_edge_cases2/whatcrimesareconsideredfeloniesvs.misdemeanorsintheus/chart_config.json index 4060753311..61ca75069e 100644 --- a/server/integration_tests/test_data/e2e_edge_cases2/whatcrimesareconsideredfeloniesvs.misdemeanorsintheus/chart_config.json +++ b/server/integration_tests/test_data/e2e_edge_cases2/whatcrimesareconsideredfeloniesvs.misdemeanorsintheus/chart_config.json @@ -12,7 +12,7 @@ "statVarKey": [ "Count_CriminalActivities_CombinedCrime" ], - "title": "Criminal Activities in United States", + "title": "Criminal Activities in United States of America", "type": "LINE" } ] @@ -20,11 +20,11 @@ { "tiles": [ { - "description": "Criminal Activities in United States", + "description": "Criminal Activities in United States of America", "statVarKey": [ "Count_CriminalActivities_CombinedCrime" ], - "title": "Criminal Activities in United States", + "title": "Criminal Activities in United States of America", "type": "HIGHLIGHT" } ] @@ -41,7 +41,7 @@ "statVarKey": [ "Count_CriminalActivities_CombinedCrime" ], - "title": "Criminal Activities in States of United States (${date})", + "title": "Criminal Activities in States of United States of America (${date})", "type": "MAP" } ] @@ -56,14 +56,14 @@ "statVarKey": [ "Count_CriminalActivities_CombinedCrime" ], - "title": "Criminal Activities in States of United States (${date})", + "title": "Criminal Activities in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Criminal Activities in States of United States" + "title": "Criminal Activities in States of United States of America" }, { "columns": [ @@ -73,7 +73,7 @@ "statVarKey": [ "Count_CriminalActivities_MurderAndNonNegligentManslaughter_AsFractionOf_Count_Person" ], - "title": "Murder and Non Negligent Manslaughter Cases Per Capita in United States", + "title": "Murder and Non Negligent Manslaughter Cases Per Capita in United States of America", "type": "LINE" } ] @@ -81,11 +81,11 @@ { "tiles": [ { - "description": "Murder and Non Negligent Manslaughter Cases Per Capita in United States", + "description": "Murder and Non Negligent Manslaughter Cases Per Capita in United States of America", "statVarKey": [ "Count_CriminalActivities_MurderAndNonNegligentManslaughter_AsFractionOf_Count_Person" ], - "title": "Murder and Non Negligent Manslaughter Cases Per Capita in United States", + "title": "Murder and Non Negligent Manslaughter Cases Per Capita in United States of America", "type": "HIGHLIGHT" } ] @@ -117,7 +117,7 @@ "Count_CriminalActivities_Robbery_multiple_place_bar_block", "Count_CriminalActivities_ViolentCrime_multiple_place_bar_block" ], - "title": "Crimes by Type in United States (${date})", + "title": "Crimes by Type in United States of America (${date})", "type": "BAR" } ] @@ -134,7 +134,7 @@ "statVarKey": [ "Count_CriminalActivities_AggravatedAssault" ], - "title": "Aggravated Assault Cases in States of United States (${date})", + "title": "Aggravated Assault Cases in States of United States of America (${date})", "type": "MAP" } ] @@ -149,14 +149,14 @@ "statVarKey": [ "Count_CriminalActivities_AggravatedAssault" ], - "title": "Aggravated Assault Cases in States of United States (${date})", + "title": "Aggravated Assault Cases in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Aggravated Assault Cases in States of United States" + "title": "Aggravated Assault Cases in States of United States of America" }, { "columns": [ @@ -166,7 +166,7 @@ "statVarKey": [ "Count_CriminalActivities_Burglary" ], - "title": "Burglaries in States of United States (${date})", + "title": "Burglaries in States of United States of America (${date})", "type": "MAP" } ] @@ -181,14 +181,14 @@ "statVarKey": [ "Count_CriminalActivities_Burglary" ], - "title": "Burglaries in States of United States (${date})", + "title": "Burglaries in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Burglaries in States of United States" + "title": "Burglaries in States of United States of America" }, { "columns": [ @@ -198,7 +198,7 @@ "statVarKey": [ "Count_CriminalActivities_ForcibleRape" ], - "title": "Forcible Rapes in States of United States (${date})", + "title": "Forcible Rapes in States of United States of America (${date})", "type": "MAP" } ] @@ -213,14 +213,14 @@ "statVarKey": [ "Count_CriminalActivities_ForcibleRape" ], - "title": "Forcible Rapes in States of United States (${date})", + "title": "Forcible Rapes in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Forcible Rapes in States of United States" + "title": "Forcible Rapes in States of United States of America" }, { "columns": [ @@ -230,7 +230,7 @@ "statVarKey": [ "Count_CriminalActivities_LarcenyTheft" ], - "title": "Larceny Theft Cases in States of United States (${date})", + "title": "Larceny Theft Cases in States of United States of America (${date})", "type": "MAP" } ] @@ -245,14 +245,14 @@ "statVarKey": [ "Count_CriminalActivities_LarcenyTheft" ], - "title": "Larceny Theft Cases in States of United States (${date})", + "title": "Larceny Theft Cases in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Larceny Theft Cases in States of United States" + "title": "Larceny Theft Cases in States of United States of America" }, { "columns": [ @@ -262,7 +262,7 @@ "statVarKey": [ "Count_CriminalActivities_MotorVehicleTheft" ], - "title": "Motor Vehicle Thefts in States of United States (${date})", + "title": "Motor Vehicle Thefts in States of United States of America (${date})", "type": "MAP" } ] @@ -277,14 +277,14 @@ "statVarKey": [ "Count_CriminalActivities_MotorVehicleTheft" ], - "title": "Motor Vehicle Thefts in States of United States (${date})", + "title": "Motor Vehicle Thefts in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Motor Vehicle Thefts in States of United States" + "title": "Motor Vehicle Thefts in States of United States of America" }, { "columns": [ @@ -294,7 +294,7 @@ "statVarKey": [ "Count_CriminalActivities_PropertyCrime" ], - "title": "Property Related Crimes in States of United States (${date})", + "title": "Property Related Crimes in States of United States of America (${date})", "type": "MAP" } ] @@ -309,14 +309,14 @@ "statVarKey": [ "Count_CriminalActivities_PropertyCrime" ], - "title": "Property Related Crimes in States of United States (${date})", + "title": "Property Related Crimes in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Property Related Crimes in States of United States" + "title": "Property Related Crimes in States of United States of America" }, { "columns": [ @@ -326,7 +326,7 @@ "statVarKey": [ "Count_CriminalActivities_Robbery" ], - "title": "Robberies in States of United States (${date})", + "title": "Robberies in States of United States of America (${date})", "type": "MAP" } ] @@ -341,14 +341,14 @@ "statVarKey": [ "Count_CriminalActivities_Robbery" ], - "title": "Robberies in States of United States (${date})", + "title": "Robberies in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Robberies in States of United States" + "title": "Robberies in States of United States of America" }, { "columns": [ @@ -358,7 +358,7 @@ "statVarKey": [ "Count_CriminalActivities_ViolentCrime" ], - "title": "Violent Crimes in States of United States (${date})", + "title": "Violent Crimes in States of United States of America (${date})", "type": "MAP" } ] @@ -373,14 +373,14 @@ "statVarKey": [ "Count_CriminalActivities_ViolentCrime" ], - "title": "Violent Crimes in States of United States (${date})", + "title": "Violent Crimes in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Violent Crimes in States of United States" + "title": "Violent Crimes in States of United States of America" } ], "statVarSpec": { @@ -474,7 +474,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -482,7 +482,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/e2e_electrification_demo/howdothesecountriescomparewiththeusandgermany/chart_config.json b/server/integration_tests/test_data/e2e_electrification_demo/howdothesecountriescomparewiththeusandgermany/chart_config.json index b3b30979d3..f0cd1c4748 100644 --- a/server/integration_tests/test_data/e2e_electrification_demo/howdothesecountriescomparewiththeusandgermany/chart_config.json +++ b/server/integration_tests/test_data/e2e_electrification_demo/howdothesecountriescomparewiththeusandgermany/chart_config.json @@ -604,7 +604,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -612,7 +612,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, { diff --git a/server/integration_tests/test_data/e2e_fallbacks/lifeexpectancyinuscounties/chart_config.json b/server/integration_tests/test_data/e2e_fallbacks/lifeexpectancyinuscounties/chart_config.json index 20c2db9669..69b029d71b 100644 --- a/server/integration_tests/test_data/e2e_fallbacks/lifeexpectancyinuscounties/chart_config.json +++ b/server/integration_tests/test_data/e2e_fallbacks/lifeexpectancyinuscounties/chart_config.json @@ -12,7 +12,7 @@ "statVarKey": [ "LifeExpectancy_Person" ], - "title": "Life Expectancy in United States", + "title": "Life Expectancy in United States of America", "type": "LINE" } ] @@ -20,11 +20,11 @@ { "tiles": [ { - "description": "Life Expectancy in United States", + "description": "Life Expectancy in United States of America", "statVarKey": [ "LifeExpectancy_Person" ], - "title": "Life Expectancy in United States", + "title": "Life Expectancy in United States of America", "type": "HIGHLIGHT" } ] @@ -41,7 +41,7 @@ "LifeExpectancy_Person_Female", "LifeExpectancy_Person_Male" ], - "title": "Life Expectancy by Gender in United States", + "title": "Life Expectancy by Gender in United States of America", "type": "LINE" } ] @@ -57,7 +57,7 @@ "statVarKey": [ "Count_Death" ], - "title": "Number of Deaths in Counties of United States (${date})", + "title": "Number of Deaths in Counties of United States of America (${date})", "type": "MAP" } ] @@ -72,14 +72,14 @@ "statVarKey": [ "Count_Death" ], - "title": "Number of Deaths in Counties of United States (${date})", + "title": "Number of Deaths in Counties of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Number of Deaths in Counties of United States" + "title": "Number of Deaths in Counties of United States of America" }, { "columns": [ @@ -89,7 +89,7 @@ "statVarKey": [ "Count_Death" ], - "title": "Number of Deaths in United States", + "title": "Number of Deaths in United States of America", "type": "LINE" } ] @@ -97,11 +97,11 @@ { "tiles": [ { - "description": "Number of Deaths in United States", + "description": "Number of Deaths in United States of America", "statVarKey": [ "Count_Death" ], - "title": "Number of Deaths in United States", + "title": "Number of Deaths in United States of America", "type": "HIGHLIGHT" } ] @@ -118,7 +118,7 @@ "statVarKey": [ "Count_Death_AsAFractionOfCount_Person" ], - "title": "Deaths Per Capita in United States", + "title": "Deaths Per Capita in United States of America", "type": "LINE" } ] @@ -126,11 +126,11 @@ { "tiles": [ { - "description": "Deaths Per Capita in United States", + "description": "Deaths Per Capita in United States of America", "statVarKey": [ "Count_Death_AsAFractionOfCount_Person" ], - "title": "Deaths Per Capita in United States", + "title": "Deaths Per Capita in United States of America", "type": "HIGHLIGHT" } ] @@ -146,7 +146,7 @@ "statVarKey": [ "Count_Death_DiseasesOfTheNervousSystem" ], - "title": "Deaths From Diseases of the Nervous System in Counties of United States (${date})", + "title": "Deaths From Diseases of the Nervous System in Counties of United States of America (${date})", "type": "MAP" } ] @@ -161,14 +161,14 @@ "statVarKey": [ "Count_Death_DiseasesOfTheNervousSystem" ], - "title": "Deaths From Diseases of the Nervous System in Counties of United States (${date})", + "title": "Deaths From Diseases of the Nervous System in Counties of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Deaths From Diseases of the Nervous System in Counties of United States" + "title": "Deaths From Diseases of the Nervous System in Counties of United States of America" }, { "columns": [ @@ -178,7 +178,7 @@ "statVarKey": [ "Count_Death_DiseasesOfTheRespiratorySystem" ], - "title": "Deaths From Diseases of the Respiratory System in Counties of United States (${date})", + "title": "Deaths From Diseases of the Respiratory System in Counties of United States of America (${date})", "type": "MAP" } ] @@ -193,14 +193,14 @@ "statVarKey": [ "Count_Death_DiseasesOfTheRespiratorySystem" ], - "title": "Deaths From Diseases of the Respiratory System in Counties of United States (${date})", + "title": "Deaths From Diseases of the Respiratory System in Counties of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Deaths From Diseases of the Respiratory System in Counties of United States" + "title": "Deaths From Diseases of the Respiratory System in Counties of United States of America" }, { "columns": [ @@ -227,7 +227,7 @@ "Count_MortalityEvent_Assault(Homicide)_multiple_place_bar_block", "Count_MortalityEvent_Suicide_multiple_place_bar_block" ], - "title": "Causes of Death in United States (${date})", + "title": "Causes of Death in United States of America (${date})", "type": "BAR" } ] @@ -243,7 +243,7 @@ "statVarKey": [ "Count_Death_Female" ], - "title": "Count of Mortality Event: Female in Counties of United States (${date})", + "title": "Count of Mortality Event: Female in Counties of United States of America (${date})", "type": "MAP" } ] @@ -258,14 +258,14 @@ "statVarKey": [ "Count_Death_Female" ], - "title": "Count of Mortality Event: Female in Counties of United States (${date})", + "title": "Count of Mortality Event: Female in Counties of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Count of Mortality Event: Female in Counties of United States" + "title": "Count of Mortality Event: Female in Counties of United States of America" }, { "columns": [ @@ -275,7 +275,7 @@ "statVarKey": [ "Count_Death_Female" ], - "title": "Count of Mortality Event: Female in United States", + "title": "Count of Mortality Event: Female in United States of America", "type": "LINE" } ] @@ -283,11 +283,11 @@ { "tiles": [ { - "description": "Count of Mortality Event: Female in United States", + "description": "Count of Mortality Event: Female in United States of America", "statVarKey": [ "Count_Death_Female" ], - "title": "Count of Mortality Event: Female in United States", + "title": "Count of Mortality Event: Female in United States of America", "type": "HIGHLIGHT" } ] @@ -304,7 +304,7 @@ "statVarKey": [ "Count_Death_AbnormalNotClassfied_Female" ], - "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in Counties of United States (${date})", + "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in Counties of United States of America (${date})", "type": "MAP" } ] @@ -319,14 +319,14 @@ "statVarKey": [ "Count_Death_AbnormalNotClassfied_Female" ], - "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in Counties of United States (${date})", + "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in Counties of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in Counties of United States" + "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in Counties of United States of America" }, { "columns": [ @@ -351,7 +351,7 @@ "Count_Death_Neoplasms_Female_multiple_place_bar_block", "Count_MortalityEvent_Assault(Homicide)_Female_multiple_place_bar_block" ], - "title": "Causes of Female Mortality in United States (${date})", + "title": "Causes of Female Mortality in United States of America (${date})", "type": "BAR" } ] @@ -368,7 +368,7 @@ "statVarKey": [ "sdg/SH_DYN_NMRT.AGE--M0" ], - "title": "Neonatal Mortality Rate in United States", + "title": "Neonatal Mortality Rate in United States of America", "type": "LINE" } ] @@ -376,11 +376,11 @@ { "tiles": [ { - "description": "Neonatal Mortality Rate in United States", + "description": "Neonatal Mortality Rate in United States of America", "statVarKey": [ "sdg/SH_DYN_NMRT.AGE--M0" ], - "title": "Neonatal Mortality Rate in United States", + "title": "Neonatal Mortality Rate in United States of America", "type": "HIGHLIGHT" } ] @@ -397,7 +397,7 @@ "statVarKey": [ "Count_Death_Upto1Years" ], - "title": "Count of Mortality Event: 1 Years or Less in Counties of United States (${date})", + "title": "Count of Mortality Event: 1 Years or Less in Counties of United States of America (${date})", "type": "MAP" } ] @@ -412,14 +412,14 @@ "statVarKey": [ "Count_Death_Upto1Years" ], - "title": "Count of Mortality Event: 1 Years or Less in Counties of United States (${date})", + "title": "Count of Mortality Event: 1 Years or Less in Counties of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Count of Mortality Event: 1 Years or Less in Counties of United States" + "title": "Count of Mortality Event: 1 Years or Less in Counties of United States of America" }, { "columns": [ @@ -429,7 +429,7 @@ "statVarKey": [ "Count_Death_Upto1Years" ], - "title": "Count of Mortality Event: 1 Years or Less in United States", + "title": "Count of Mortality Event: 1 Years or Less in United States of America", "type": "LINE" } ] @@ -437,11 +437,11 @@ { "tiles": [ { - "description": "Count of Mortality Event: 1 Years or Less in United States", + "description": "Count of Mortality Event: 1 Years or Less in United States of America", "statVarKey": [ "Count_Death_Upto1Years" ], - "title": "Count of Mortality Event: 1 Years or Less in United States", + "title": "Count of Mortality Event: 1 Years or Less in United States of America", "type": "HIGHLIGHT" } ] @@ -458,7 +458,7 @@ "statVarKey": [ "Count_Death_Upto1Years_CertainConditionsOriginatingInThePerinatalPeriod" ], - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of United States (${date})", + "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of United States of America (${date})", "type": "MAP" } ] @@ -473,14 +473,14 @@ "statVarKey": [ "Count_Death_Upto1Years_CertainConditionsOriginatingInThePerinatalPeriod" ], - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of United States (${date})", + "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of United States" + "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in Counties of United States of America" }, { "columns": [ @@ -503,7 +503,7 @@ "Count_Death_Upto1Years_DiseasesOfTheCirculatorySystem_multiple_place_bar_block", "Count_Death_Upto1Years_Neoplasms_multiple_place_bar_block" ], - "title": "Causes of Infant Mortality in United States (${date})", + "title": "Causes of Infant Mortality in United States of America (${date})", "type": "BAR" } ] @@ -521,7 +521,7 @@ "sdg/SH_DYN_IMRT.AGE--Y0__SEX--F", "sdg/SH_DYN_IMRT.AGE--Y0__SEX--M" ], - "title": "Infant Mortality Rate by Gender in United States", + "title": "Infant Mortality Rate by Gender in United States of America", "type": "LINE" } ] @@ -537,7 +537,7 @@ "statVarKey": [ "Count_Death_AgeAdjusted_AsAFractionOf_Count_Person" ], - "title": "Mortality Rate (Age Adjusted, Per Capita) in United States", + "title": "Mortality Rate (Age Adjusted, Per Capita) in United States of America", "type": "LINE" } ] @@ -545,11 +545,11 @@ { "tiles": [ { - "description": "Mortality Rate (Age Adjusted, Per Capita) in United States", + "description": "Mortality Rate (Age Adjusted, Per Capita) in United States of America", "statVarKey": [ "Count_Death_AgeAdjusted_AsAFractionOf_Count_Person" ], - "title": "Mortality Rate (Age Adjusted, Per Capita) in United States", + "title": "Mortality Rate (Age Adjusted, Per Capita) in United States of America", "type": "HIGHLIGHT" } ] @@ -565,7 +565,7 @@ "statVarKey": [ "Mean_IntervalSinceLastBirth_BirthEvent_LiveBirth" ], - "title": "Average Interval in Months Since Last Live Birth in Counties of United States (${date})", + "title": "Average Interval in Months Since Last Live Birth in Counties of United States of America (${date})", "type": "MAP" } ] @@ -580,13 +580,13 @@ "statVarKey": [ "Mean_IntervalSinceLastBirth_BirthEvent_LiveBirth" ], - "title": "Average Interval in Months Since Last Live Birth in Counties of United States (${date})", + "title": "Average Interval in Months Since Last Live Birth in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Average Interval in Months Since Last Live Birth in Counties of United States" + "title": "Average Interval in Months Since Last Live Birth in Counties of United States of America" }, { "columns": [ @@ -596,7 +596,7 @@ "statVarKey": [ "Count_Death_Male_AgeAdjusted_AsAFractionOf_Count_Person_Male" ], - "title": "Male Mortality Rate (Age Adjusted) in United States", + "title": "Male Mortality Rate (Age Adjusted) in United States of America", "type": "LINE" } ] @@ -604,11 +604,11 @@ { "tiles": [ { - "description": "Male Mortality Rate (Age Adjusted) in United States", + "description": "Male Mortality Rate (Age Adjusted) in United States of America", "statVarKey": [ "Count_Death_Male_AgeAdjusted_AsAFractionOf_Count_Person_Male" ], - "title": "Male Mortality Rate (Age Adjusted) in United States", + "title": "Male Mortality Rate (Age Adjusted) in United States of America", "type": "HIGHLIGHT" } ] @@ -624,7 +624,7 @@ "statVarKey": [ "Count_Death_0Years_AsFractionOf_Count_BirthEvent_LiveBirth" ], - "title": "Infant Mortality Rate in United States", + "title": "Infant Mortality Rate in United States of America", "type": "LINE" } ] @@ -632,11 +632,11 @@ { "tiles": [ { - "description": "Infant Mortality Rate in United States", + "description": "Infant Mortality Rate in United States of America", "statVarKey": [ "Count_Death_0Years_AsFractionOf_Count_BirthEvent_LiveBirth" ], - "title": "Infant Mortality Rate in United States", + "title": "Infant Mortality Rate in United States of America", "type": "HIGHLIGHT" } ] @@ -653,7 +653,7 @@ "statVarKey": [ "Count_Death_LessThan1Year_AsAFractionOf_Count_BirthEvent" ], - "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in United States", + "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in United States of America", "type": "LINE" } ] @@ -661,11 +661,11 @@ { "tiles": [ { - "description": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in United States", + "description": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in United States of America", "statVarKey": [ "Count_Death_LessThan1Year_AsAFractionOf_Count_BirthEvent" ], - "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in United States", + "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in United States of America", "type": "HIGHLIGHT" } ] @@ -681,7 +681,7 @@ "statVarKey": [ "Count_Death_Female_AgeAdjusted_AsAFractionOf_Count_Person_Female" ], - "title": "Female Mortality Rate (Age Adjusted) in United States", + "title": "Female Mortality Rate (Age Adjusted) in United States of America", "type": "LINE" } ] @@ -689,11 +689,11 @@ { "tiles": [ { - "description": "Female Mortality Rate (Age Adjusted) in United States", + "description": "Female Mortality Rate (Age Adjusted) in United States of America", "statVarKey": [ "Count_Death_Female_AgeAdjusted_AsAFractionOf_Count_Person_Female" ], - "title": "Female Mortality Rate (Age Adjusted) in United States", + "title": "Female Mortality Rate (Age Adjusted) in United States of America", "type": "HIGHLIGHT" } ] @@ -897,7 +897,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -905,7 +905,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/e2e_fallbacks/tamilspeakersinuscounties/chart_config.json b/server/integration_tests/test_data/e2e_fallbacks/tamilspeakersinuscounties/chart_config.json index 03d2184ee8..3ac6134b61 100644 --- a/server/integration_tests/test_data/e2e_fallbacks/tamilspeakersinuscounties/chart_config.json +++ b/server/integration_tests/test_data/e2e_fallbacks/tamilspeakersinuscounties/chart_config.json @@ -12,7 +12,7 @@ "statVarKey": [ "Count_Person_5OrMoreYears_TamilSpokenAtHome" ], - "title": "Population: Tamil Spoken at Home in States of United States (${date})", + "title": "Population: Tamil Spoken at Home in States of United States of America (${date})", "type": "MAP" } ] @@ -27,14 +27,14 @@ "statVarKey": [ "Count_Person_5OrMoreYears_TamilSpokenAtHome" ], - "title": "Population: Tamil Spoken at Home in States of United States (${date})", + "title": "Population: Tamil Spoken at Home in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Population: Tamil Spoken at Home in States of United States" + "title": "Population: Tamil Spoken at Home in States of United States of America" }, { "columns": [ @@ -44,7 +44,7 @@ "statVarKey": [ "Count_Person_5OrMoreYears_TamilSpokenAtHome" ], - "title": "Population: Tamil Spoken at Home in United States", + "title": "Population: Tamil Spoken at Home in United States of America", "type": "LINE" } ] @@ -52,11 +52,11 @@ { "tiles": [ { - "description": "Population: Tamil Spoken at Home in United States", + "description": "Population: Tamil Spoken at Home in United States of America", "statVarKey": [ "Count_Person_5OrMoreYears_TamilSpokenAtHome" ], - "title": "Population: Tamil Spoken at Home in United States", + "title": "Population: Tamil Spoken at Home in United States of America", "type": "HIGHLIGHT" } ] @@ -73,7 +73,7 @@ "statVarKey": [ "Count_Person_5OrMoreYears_MalayalamKannadaOrOtherDravidianLanguagesSpokenAtHome" ], - "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in States of United States (${date})", + "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in States of United States of America (${date})", "type": "MAP" } ] @@ -88,14 +88,14 @@ "statVarKey": [ "Count_Person_5OrMoreYears_MalayalamKannadaOrOtherDravidianLanguagesSpokenAtHome" ], - "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in States of United States (${date})", + "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in States of United States" + "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in States of United States of America" }, { "columns": [ @@ -105,7 +105,7 @@ "statVarKey": [ "Count_Person_5OrMoreYears_MalayalamKannadaOrOtherDravidianLanguagesSpokenAtHome" ], - "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in United States", + "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in United States of America", "type": "LINE" } ] @@ -113,11 +113,11 @@ { "tiles": [ { - "description": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in United States", + "description": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in United States of America", "statVarKey": [ "Count_Person_5OrMoreYears_MalayalamKannadaOrOtherDravidianLanguagesSpokenAtHome" ], - "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in United States", + "title": "Population: Malayalam Kannada or Other Dravidian Languages Spoken at Home in United States of America", "type": "HIGHLIGHT" } ] @@ -154,32 +154,32 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": { "newPlace": { "country": "country/USA", "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, - "newStr": "states in United States", + "newStr": "states in United States of America", "newType": "State", "origPlace": { "country": "country/USA", "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, - "origStr": "counties in United States", + "origStr": "counties in United States of America", "origType": "County" }, "placeSource": "CURRENT_QUERY", "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], @@ -232,6 +232,6 @@ }, "svSource": "CURRENT_QUERY", "userMessages": [ - "Sorry, there were no relevant statistics for counties in United States. See results for states in United States." + "Sorry, there were no relevant statistics for counties in United States of America. See results for states in United States of America." ] } \ No newline at end of file diff --git a/server/integration_tests/test_data/e2e_single_date/lifeexpectancyinusstatesin2018/chart_config.json b/server/integration_tests/test_data/e2e_single_date/lifeexpectancyinusstatesin2018/chart_config.json index 9e8a54c991..0ba195adc4 100644 --- a/server/integration_tests/test_data/e2e_single_date/lifeexpectancyinusstatesin2018/chart_config.json +++ b/server/integration_tests/test_data/e2e_single_date/lifeexpectancyinusstatesin2018/chart_config.json @@ -12,7 +12,7 @@ "statVarKey": [ "LifeExpectancy_Person_2018" ], - "title": "Life Expectancy in States of United States (${date})", + "title": "Life Expectancy in States of United States of America (${date})", "type": "MAP" } ] @@ -27,13 +27,13 @@ "statVarKey": [ "LifeExpectancy_Person_2018" ], - "title": "Life Expectancy in States of United States (${date})", + "title": "Life Expectancy in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Life Expectancy in States of United States" + "title": "Life Expectancy in States of United States of America" }, { "columns": [ @@ -46,7 +46,7 @@ "statVarKey": [ "LifeExpectancy_Person_2018_3563600999" ], - "title": "Life Expectancy in United States", + "title": "Life Expectancy in United States of America", "type": "LINE" } ] @@ -54,11 +54,11 @@ { "tiles": [ { - "description": "Life Expectancy in United States", + "description": "Life Expectancy in United States of America", "statVarKey": [ "LifeExpectancy_Person_2018" ], - "title": "Life Expectancy in United States", + "title": "Life Expectancy in United States of America", "type": "HIGHLIGHT" } ] @@ -74,7 +74,7 @@ "statVarKey": [ "LifeExpectancy_Person_Female_2018" ], - "title": "Female Life Expectancy in States of United States (${date})", + "title": "Female Life Expectancy in States of United States of America (${date})", "type": "MAP" } ] @@ -89,14 +89,14 @@ "statVarKey": [ "LifeExpectancy_Person_Female_2018" ], - "title": "Female Life Expectancy in States of United States (${date})", + "title": "Female Life Expectancy in States of United States of America (${date})", "type": "RANKING" } ] } ], "description": "Life expectancy at birth indicates the number of years a newborn infant would live if prevailing patterns of mortality at the time of its birth were to stay the same throughout its life. (1) united nations population division. World population prospects: 2019 revision. (2) census reports and other statistical publications from national statistical offices, (3) eurostat: demographic statistics, (4) united nations statistical division. Population and vital statistics report (various years), (5) u.S. Census bureau: international database, and (6) secretariat of the pacific community: statistics and demography programme.", - "title": "Female Life Expectancy in States of United States" + "title": "Female Life Expectancy in States of United States of America" }, { "columns": [ @@ -106,7 +106,7 @@ "statVarKey": [ "LifeExpectancy_Person_Male_2018" ], - "title": "Male Life Expectancy in States of United States (${date})", + "title": "Male Life Expectancy in States of United States of America (${date})", "type": "MAP" } ] @@ -121,14 +121,14 @@ "statVarKey": [ "LifeExpectancy_Person_Male_2018" ], - "title": "Male Life Expectancy in States of United States (${date})", + "title": "Male Life Expectancy in States of United States of America (${date})", "type": "RANKING" } ] } ], "description": "Life expectancy at birth indicates the number of years a newborn infant would live if prevailing patterns of mortality at the time of its birth were to stay the same throughout its life. (1) united nations population division. World population prospects: 2019 revision. (2) census reports and other statistical publications from national statistical offices, (3) eurostat: demographic statistics, (4) united nations statistical division. Population and vital statistics report (various years), (5) u.S. Census bureau: international database, and (6) secretariat of the pacific community: statistics and demography programme.", - "title": "Male Life Expectancy in States of United States" + "title": "Male Life Expectancy in States of United States of America" }, { "columns": [ @@ -142,7 +142,7 @@ "LifeExpectancy_Person_Female_2018_2776657033", "LifeExpectancy_Person_Male_2018_2776657033" ], - "title": "Life Expectancy by Gender in United States", + "title": "Life Expectancy by Gender in United States of America", "type": "LINE" } ] @@ -158,7 +158,7 @@ "statVarKey": [ "Count_Death_2018" ], - "title": "Number of Deaths in States of United States (${date})", + "title": "Number of Deaths in States of United States of America (${date})", "type": "MAP" } ] @@ -173,14 +173,14 @@ "statVarKey": [ "Count_Death_2018" ], - "title": "Number of Deaths in States of United States (${date})", + "title": "Number of Deaths in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Number of Deaths in States of United States" + "title": "Number of Deaths in States of United States of America" }, { "columns": [ @@ -193,7 +193,7 @@ "statVarKey": [ "Count_Death_2018_1437305810" ], - "title": "Number of Deaths in United States", + "title": "Number of Deaths in United States of America", "type": "LINE" } ] @@ -201,11 +201,11 @@ { "tiles": [ { - "description": "Number of Deaths in United States", + "description": "Number of Deaths in United States of America", "statVarKey": [ "Count_Death_2018" ], - "title": "Number of Deaths in United States", + "title": "Number of Deaths in United States of America", "type": "HIGHLIGHT" } ] @@ -225,7 +225,7 @@ "statVarKey": [ "Count_Death_AsAFractionOfCount_Person_2018_1113810078" ], - "title": "Deaths Per Capita in United States", + "title": "Deaths Per Capita in United States of America", "type": "LINE" } ] @@ -233,11 +233,11 @@ { "tiles": [ { - "description": "Deaths Per Capita in United States", + "description": "Deaths Per Capita in United States of America", "statVarKey": [ "Count_Death_AsAFractionOfCount_Person_2018" ], - "title": "Deaths Per Capita in United States", + "title": "Deaths Per Capita in United States of America", "type": "HIGHLIGHT" } ] @@ -253,7 +253,7 @@ "statVarKey": [ "Count_Death_DiseasesOfTheCirculatorySystem_2018" ], - "title": "Deaths From Diseases of the Circulatory System in States of United States (${date})", + "title": "Deaths From Diseases of the Circulatory System in States of United States of America (${date})", "type": "MAP" } ] @@ -268,14 +268,14 @@ "statVarKey": [ "Count_Death_DiseasesOfTheCirculatorySystem_2018" ], - "title": "Deaths From Diseases of the Circulatory System in States of United States (${date})", + "title": "Deaths From Diseases of the Circulatory System in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Deaths From Diseases of the Circulatory System in States of United States" + "title": "Deaths From Diseases of the Circulatory System in States of United States of America" }, { "columns": [ @@ -302,7 +302,7 @@ "Count_MortalityEvent_Assault(Homicide)_multiple_place_bar_block_2018", "Count_MortalityEvent_Suicide_multiple_place_bar_block_2018" ], - "title": "Causes of Death in United States (${date})", + "title": "Causes of Death in United States of America (${date})", "type": "BAR" } ] @@ -318,7 +318,7 @@ "statVarKey": [ "Count_Death_Female_2018" ], - "title": "Count of Mortality Event: Female in States of United States (${date})", + "title": "Count of Mortality Event: Female in States of United States of America (${date})", "type": "MAP" } ] @@ -333,14 +333,14 @@ "statVarKey": [ "Count_Death_Female_2018" ], - "title": "Count of Mortality Event: Female in States of United States (${date})", + "title": "Count of Mortality Event: Female in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Count of Mortality Event: Female in States of United States" + "title": "Count of Mortality Event: Female in States of United States of America" }, { "columns": [ @@ -353,7 +353,7 @@ "statVarKey": [ "Count_Death_Female_2018_1437305810" ], - "title": "Count of Mortality Event: Female in United States", + "title": "Count of Mortality Event: Female in United States of America", "type": "LINE" } ] @@ -361,11 +361,11 @@ { "tiles": [ { - "description": "Count of Mortality Event: Female in United States", + "description": "Count of Mortality Event: Female in United States of America", "statVarKey": [ "Count_Death_Female_2018" ], - "title": "Count of Mortality Event: Female in United States", + "title": "Count of Mortality Event: Female in United States of America", "type": "HIGHLIGHT" } ] @@ -382,7 +382,7 @@ "statVarKey": [ "Count_Death_AbnormalNotClassfied_Female_2018" ], - "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in States of United States (${date})", + "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in States of United States of America (${date})", "type": "MAP" } ] @@ -397,14 +397,14 @@ "statVarKey": [ "Count_Death_AbnormalNotClassfied_Female_2018" ], - "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in States of United States (${date})", + "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in States of United States" + "title": "Female Deaths Due to Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified in States of United States of America" }, { "columns": [ @@ -414,7 +414,7 @@ "statVarKey": [ "Count_Death_CertainConditionsOriginatingInThePerinatalPeriod_Female_2018" ], - "title": "Female Deaths Due to Certain Conditions Originating in the Perinatal Period in States of United States (${date})", + "title": "Female Deaths Due to Certain Conditions Originating in the Perinatal Period in States of United States of America (${date})", "type": "MAP" } ] @@ -429,14 +429,14 @@ "statVarKey": [ "Count_Death_CertainConditionsOriginatingInThePerinatalPeriod_Female_2018" ], - "title": "Female Deaths Due to Certain Conditions Originating in the Perinatal Period in States of United States (${date})", + "title": "Female Deaths Due to Certain Conditions Originating in the Perinatal Period in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Female Deaths Due to Certain Conditions Originating in the Perinatal Period in States of United States" + "title": "Female Deaths Due to Certain Conditions Originating in the Perinatal Period in States of United States of America" }, { "columns": [ @@ -461,7 +461,7 @@ "Count_Death_Neoplasms_Female_multiple_place_bar_block_2018", "Count_MortalityEvent_Assault(Homicide)_Female_multiple_place_bar_block_2018" ], - "title": "Causes of Female Mortality in United States (${date})", + "title": "Causes of Female Mortality in United States of America (${date})", "type": "BAR" } ] @@ -481,7 +481,7 @@ "statVarKey": [ "sdg/SH_DYN_NMRT.AGE--M0_2018_2966989201" ], - "title": "Neonatal Mortality Rate in United States", + "title": "Neonatal Mortality Rate in United States of America", "type": "LINE" } ] @@ -489,11 +489,11 @@ { "tiles": [ { - "description": "Neonatal Mortality Rate in United States", + "description": "Neonatal Mortality Rate in United States of America", "statVarKey": [ "sdg/SH_DYN_NMRT.AGE--M0_2018" ], - "title": "Neonatal Mortality Rate in United States", + "title": "Neonatal Mortality Rate in United States of America", "type": "HIGHLIGHT" } ] @@ -510,7 +510,7 @@ "statVarKey": [ "Count_Death_Upto1Years_AbnormalNotClassfied_2018" ], - "title": "Mortality Events (1 Years or Less): Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified) in States of United States (${date})", + "title": "Mortality Events (1 Years or Less): Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified) in States of United States of America (${date})", "type": "MAP" } ] @@ -525,14 +525,14 @@ "statVarKey": [ "Count_Death_Upto1Years_AbnormalNotClassfied_2018" ], - "title": "Mortality Events (1 Years or Less): Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified) in States of United States (${date})", + "title": "Mortality Events (1 Years or Less): Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified) in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Mortality Events (1 Years or Less): Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified) in States of United States" + "title": "Mortality Events (1 Years or Less): Symptoms, Signs and Abnormal Clinical and Laboratory Findings, Not Elsewhere Classified) in States of United States of America" }, { "columns": [ @@ -542,7 +542,7 @@ "statVarKey": [ "Count_Death_Upto1Years_CertainConditionsOriginatingInThePerinatalPeriod_2018" ], - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in States of United States (${date})", + "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in States of United States of America (${date})", "type": "MAP" } ] @@ -557,14 +557,14 @@ "statVarKey": [ "Count_Death_Upto1Years_CertainConditionsOriginatingInThePerinatalPeriod_2018" ], - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in States of United States (${date})", + "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in States of United States" + "title": "Mortality Events (1 Years or Less): Certain Conditions Originating in the Perinatal Period) in States of United States of America" }, { "columns": [ @@ -587,7 +587,7 @@ "Count_Death_Upto1Years_DiseasesOfTheCirculatorySystem_multiple_place_bar_block_2018", "Count_Death_Upto1Years_Neoplasms_multiple_place_bar_block_2018" ], - "title": "Causes of Infant Mortality in United States (${date})", + "title": "Causes of Infant Mortality in United States of America (${date})", "type": "BAR" } ] @@ -608,7 +608,7 @@ "sdg/SH_DYN_IMRT.AGE--Y0__SEX--F_2018_2966989201", "sdg/SH_DYN_IMRT.AGE--Y0__SEX--M_2018_2966989201" ], - "title": "Infant Mortality Rate by Gender in United States", + "title": "Infant Mortality Rate by Gender in United States of America", "type": "LINE" } ] @@ -624,7 +624,7 @@ "statVarKey": [ "Count_Death_AgeAdjusted_AsAFractionOf_Count_Person_2018" ], - "title": "Mortality Rate (Age Adjusted, Per Capita) in States of United States (${date})", + "title": "Mortality Rate (Age Adjusted, Per Capita) in States of United States of America (${date})", "type": "MAP" } ] @@ -639,13 +639,13 @@ "statVarKey": [ "Count_Death_AgeAdjusted_AsAFractionOf_Count_Person_2018" ], - "title": "Mortality Rate (Age Adjusted, Per Capita) in States of United States (${date})", + "title": "Mortality Rate (Age Adjusted, Per Capita) in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Mortality Rate (Age Adjusted, Per Capita) in States of United States" + "title": "Mortality Rate (Age Adjusted, Per Capita) in States of United States of America" }, { "columns": [ @@ -658,7 +658,7 @@ "statVarKey": [ "Count_Death_AgeAdjusted_AsAFractionOf_Count_Person_2018_1123266408" ], - "title": "Mortality Rate (Age Adjusted, Per Capita) in United States", + "title": "Mortality Rate (Age Adjusted, Per Capita) in United States of America", "type": "LINE" } ] @@ -666,11 +666,11 @@ { "tiles": [ { - "description": "Mortality Rate (Age Adjusted, Per Capita) in United States", + "description": "Mortality Rate (Age Adjusted, Per Capita) in United States of America", "statVarKey": [ "Count_Death_AgeAdjusted_AsAFractionOf_Count_Person_2018" ], - "title": "Mortality Rate (Age Adjusted, Per Capita) in United States", + "title": "Mortality Rate (Age Adjusted, Per Capita) in United States of America", "type": "HIGHLIGHT" } ] @@ -686,7 +686,7 @@ "statVarKey": [ "Mean_IntervalSinceLastBirth_BirthEvent_LiveBirth_2018" ], - "title": "Average Interval in Months Since Last Live Birth in States of United States (${date})", + "title": "Average Interval in Months Since Last Live Birth in States of United States of America (${date})", "type": "MAP" } ] @@ -701,13 +701,13 @@ "statVarKey": [ "Mean_IntervalSinceLastBirth_BirthEvent_LiveBirth_2018" ], - "title": "Average Interval in Months Since Last Live Birth in States of United States (${date})", + "title": "Average Interval in Months Since Last Live Birth in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Average Interval in Months Since Last Live Birth in States of United States" + "title": "Average Interval in Months Since Last Live Birth in States of United States of America" }, { "columns": [ @@ -720,7 +720,7 @@ "statVarKey": [ "Count_Death_0Years_AsFractionOf_Count_BirthEvent_LiveBirth_2018_606064963" ], - "title": "Infant Mortality Rate in United States", + "title": "Infant Mortality Rate in United States of America", "type": "LINE" } ] @@ -728,11 +728,11 @@ { "tiles": [ { - "description": "Infant Mortality Rate in United States", + "description": "Infant Mortality Rate in United States of America", "statVarKey": [ "Count_Death_0Years_AsFractionOf_Count_BirthEvent_LiveBirth_2018" ], - "title": "Infant Mortality Rate in United States", + "title": "Infant Mortality Rate in United States of America", "type": "HIGHLIGHT" } ] @@ -749,7 +749,7 @@ "statVarKey": [ "Count_Death_LessThan1Year_AsAFractionOf_Count_BirthEvent_2018" ], - "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in States of United States (${date})", + "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in States of United States of America (${date})", "type": "MAP" } ] @@ -764,13 +764,13 @@ "statVarKey": [ "Count_Death_LessThan1Year_AsAFractionOf_Count_BirthEvent_2018" ], - "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in States of United States (${date})", + "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in States of United States" + "title": "Count of Mortality Event: 1 Years or Less (As Fraction of Count Birth Event) in States of United States of America" }, { "columns": [ @@ -780,7 +780,7 @@ "statVarKey": [ "Median_Age_Person_2018" ], - "title": "Median Age of Population in States of United States (${date})", + "title": "Median Age of Population in States of United States of America (${date})", "type": "MAP" } ] @@ -795,14 +795,14 @@ "statVarKey": [ "Median_Age_Person_2018" ], - "title": "Median Age of Population in States of United States (${date})", + "title": "Median Age of Population in States of United States of America (${date})", "type": "RANKING" } ] } ], "description": "The median age of people in a population.", - "title": "Median Age of Population in States of United States" + "title": "Median Age of Population in States of United States of America" }, { "columns": [ @@ -815,7 +815,7 @@ "statVarKey": [ "Median_Age_Person_2018_3795540742" ], - "title": "Median Age of Population in United States", + "title": "Median Age of Population in United States of America", "type": "LINE" } ] @@ -823,11 +823,11 @@ { "tiles": [ { - "description": "Median Age of Population in United States", + "description": "Median Age of Population in United States of America", "statVarKey": [ "Median_Age_Person_2018" ], - "title": "Median Age of Population in United States", + "title": "Median Age of Population in United States of America", "type": "HIGHLIGHT" } ] @@ -1133,7 +1133,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -1141,7 +1141,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/e2e_single_date/populationintheusinthelastyear/chart_config.json b/server/integration_tests/test_data/e2e_single_date/populationintheusinthelastyear/chart_config.json index 2ed230d4a2..8516374ead 100644 --- a/server/integration_tests/test_data/e2e_single_date/populationintheusinthelastyear/chart_config.json +++ b/server/integration_tests/test_data/e2e_single_date/populationintheusinthelastyear/chart_config.json @@ -15,7 +15,7 @@ "statVarKey": [ "Count_Person_2176550201" ], - "title": "Population in United States", + "title": "Population in United States of America", "type": "LINE" } ] @@ -23,11 +23,11 @@ { "tiles": [ { - "description": "Population in United States", + "description": "Population in United States of America", "statVarKey": [ "Count_Person" ], - "title": "Population in United States", + "title": "Population in United States of America", "type": "HIGHLIGHT" } ] @@ -44,7 +44,7 @@ "statVarKey": [ "Count_Person" ], - "title": "Population in States of United States (${date})", + "title": "Population in States of United States of America (${date})", "type": "MAP" } ] @@ -59,14 +59,14 @@ "statVarKey": [ "Count_Person" ], - "title": "Population in States of United States (${date})", + "title": "Population in States of United States of America (${date})", "type": "RANKING" } ] } ], "description": "The total number of people in a population.", - "title": "Population in States of United States" + "title": "Population in States of United States of America" }, { "columns": [ @@ -79,7 +79,7 @@ "statVarKey": [ "Count_Person_Employed_3707913853" ], - "title": "Population With Current Employment in United States", + "title": "Population With Current Employment in United States of America", "type": "LINE" } ] @@ -87,11 +87,11 @@ { "tiles": [ { - "description": "Population With Current Employment in United States", + "description": "Population With Current Employment in United States of America", "statVarKey": [ "Count_Person_Employed" ], - "title": "Population With Current Employment in United States", + "title": "Population With Current Employment in United States of America", "type": "HIGHLIGHT" } ] @@ -108,7 +108,7 @@ "statVarKey": [ "Count_Person_Employed" ], - "title": "Population With Current Employment in States of United States (${date})", + "title": "Population With Current Employment in States of United States of America (${date})", "type": "MAP" } ] @@ -123,14 +123,14 @@ "statVarKey": [ "Count_Person_Employed" ], - "title": "Population With Current Employment in States of United States (${date})", + "title": "Population With Current Employment in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Population With Current Employment in States of United States" + "title": "Population With Current Employment in States of United States of America" }, { "columns": [ @@ -143,7 +143,7 @@ "statVarKey": [ "Count_Person_InLaborForce_3707913853" ], - "title": "Population in the Labor Force in United States", + "title": "Population in the Labor Force in United States of America", "type": "LINE" } ] @@ -151,11 +151,11 @@ { "tiles": [ { - "description": "Population in the Labor Force in United States", + "description": "Population in the Labor Force in United States of America", "statVarKey": [ "Count_Person_InLaborForce" ], - "title": "Population in the Labor Force in United States", + "title": "Population in the Labor Force in United States of America", "type": "HIGHLIGHT" } ] @@ -172,7 +172,7 @@ "statVarKey": [ "Count_Person_InLaborForce" ], - "title": "Population in the Labor Force in States of United States (${date})", + "title": "Population in the Labor Force in States of United States of America (${date})", "type": "MAP" } ] @@ -187,14 +187,14 @@ "statVarKey": [ "Count_Person_InLaborForce" ], - "title": "Population in the Labor Force in States of United States (${date})", + "title": "Population in the Labor Force in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Population in the Labor Force in States of United States" + "title": "Population in the Labor Force in States of United States of America" }, { "columns": [ @@ -207,7 +207,7 @@ "statVarKey": [ "Count_Person_ResidesInHousehold_1926704588" ], - "title": "Total Number of People Residing in Households in United States", + "title": "Total Number of People Residing in Households in United States of America", "type": "LINE" } ] @@ -215,11 +215,11 @@ { "tiles": [ { - "description": "Total Number of People Residing in Households in United States", + "description": "Total Number of People Residing in Households in United States of America", "statVarKey": [ "Count_Person_ResidesInHousehold" ], - "title": "Total Number of People Residing in Households in United States", + "title": "Total Number of People Residing in Households in United States of America", "type": "HIGHLIGHT" } ] @@ -284,7 +284,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -292,7 +292,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/e2e_toolformer_rag_mode/howhaslifeexpectancychangedovertimeacrossusstates/chart_config.json b/server/integration_tests/test_data/e2e_toolformer_rag_mode/howhaslifeexpectancychangedovertimeacrossusstates/chart_config.json index 1eed7020a4..07f0229106 100644 --- a/server/integration_tests/test_data/e2e_toolformer_rag_mode/howhaslifeexpectancychangedovertimeacrossusstates/chart_config.json +++ b/server/integration_tests/test_data/e2e_toolformer_rag_mode/howhaslifeexpectancychangedovertimeacrossusstates/chart_config.json @@ -1336,7 +1336,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -1344,7 +1344,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/e2e_us_demo/howdoeshouseholdincomecomparewithratesofdiabetesinusacounties/chart_config.json b/server/integration_tests/test_data/e2e_us_demo/howdoeshouseholdincomecomparewithratesofdiabetesinusacounties/chart_config.json index d2b44549e3..62f5b6d723 100644 --- a/server/integration_tests/test_data/e2e_us_demo/howdoeshouseholdincomecomparewithratesofdiabetesinusacounties/chart_config.json +++ b/server/integration_tests/test_data/e2e_us_demo/howdoeshouseholdincomecomparewithratesofdiabetesinusacounties/chart_config.json @@ -16,7 +16,7 @@ "Mean_Income_Household_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Average Income for Households (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Average Income for Households (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -32,7 +32,7 @@ "statVarKey": [ "Mean_Income_Household" ], - "title": "Average Income for Households in Counties of United States (${date})", + "title": "Average Income for Households in Counties of United States of America (${date})", "type": "MAP" } ] @@ -47,13 +47,13 @@ "statVarKey": [ "Mean_Income_Household" ], - "title": "Average Income for Households in Counties of United States (${date})", + "title": "Average Income for Households in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Average Income for Households in Counties of United States" + "title": "Average Income for Households in Counties of United States of America" }, { "columns": [ @@ -63,7 +63,7 @@ "statVarKey": [ "Percent_Person_WithDiabetes" ], - "title": "Diabetes in Counties of United States (${date})", + "title": "Diabetes in Counties of United States of America (${date})", "type": "MAP" } ] @@ -78,13 +78,13 @@ "statVarKey": [ "Percent_Person_WithDiabetes" ], - "title": "Diabetes in Counties of United States (${date})", + "title": "Diabetes in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Diabetes in Counties of United States" + "title": "Diabetes in Counties of United States of America" }, { "columns": [ @@ -98,7 +98,7 @@ "Mean_Income_Household_FamilyHousehold_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Average Income for Family Households (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Average Income for Family Households (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -114,7 +114,7 @@ "statVarKey": [ "Mean_Income_Household_FamilyHousehold" ], - "title": "Average Income for Family Households in Counties of United States (${date})", + "title": "Average Income for Family Households in Counties of United States of America (${date})", "type": "MAP" } ] @@ -129,13 +129,13 @@ "statVarKey": [ "Mean_Income_Household_FamilyHousehold" ], - "title": "Average Income for Family Households in Counties of United States (${date})", + "title": "Average Income for Family Households in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Average Income for Family Households in Counties of United States" + "title": "Average Income for Family Households in Counties of United States of America" }, { "columns": [ @@ -149,7 +149,7 @@ "Median_Income_Household_FamilyHousehold_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Median Family Household Income (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Median Family Household Income (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -165,7 +165,7 @@ "statVarKey": [ "Median_Income_Household_FamilyHousehold" ], - "title": "Median Family Household Income in Counties of United States (${date})", + "title": "Median Family Household Income in Counties of United States of America (${date})", "type": "MAP" } ] @@ -180,13 +180,13 @@ "statVarKey": [ "Median_Income_Household_FamilyHousehold" ], - "title": "Median Family Household Income in Counties of United States (${date})", + "title": "Median Family Household Income in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Median Family Household Income in Counties of United States" + "title": "Median Family Household Income in Counties of United States of America" }, { "columns": [ @@ -200,7 +200,7 @@ "Median_Income_Household_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Household Median Income (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Household Median Income (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -216,7 +216,7 @@ "statVarKey": [ "Median_Income_Household" ], - "title": "Household Median Income in Counties of United States (${date})", + "title": "Household Median Income in Counties of United States of America (${date})", "type": "MAP" } ] @@ -231,13 +231,13 @@ "statVarKey": [ "Median_Income_Household" ], - "title": "Household Median Income in Counties of United States (${date})", + "title": "Household Median Income in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Household Median Income in Counties of United States" + "title": "Household Median Income in Counties of United States of America" }, { "columns": [ @@ -251,7 +251,7 @@ "Median_Income_Household_MarriedCoupleFamilyHousehold_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Median Married Couple Family Household Income (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Median Married Couple Family Household Income (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -267,7 +267,7 @@ "statVarKey": [ "Median_Income_Household_MarriedCoupleFamilyHousehold" ], - "title": "Median Married Couple Family Household Income in Counties of United States (${date})", + "title": "Median Married Couple Family Household Income in Counties of United States of America (${date})", "type": "MAP" } ] @@ -282,13 +282,13 @@ "statVarKey": [ "Median_Income_Household_MarriedCoupleFamilyHousehold" ], - "title": "Median Married Couple Family Household Income in Counties of United States (${date})", + "title": "Median Married Couple Family Household Income in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Median Married Couple Family Household Income in Counties of United States" + "title": "Median Married Couple Family Household Income in Counties of United States of America" }, { "columns": [ @@ -302,7 +302,7 @@ "Median_Income_Household_NonfamilyHousehold_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Nonfamily Household Median Income (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Nonfamily Household Median Income (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -318,7 +318,7 @@ "statVarKey": [ "Median_Income_Household_NonfamilyHousehold" ], - "title": "Nonfamily Household Median Income in Counties of United States (${date})", + "title": "Nonfamily Household Median Income in Counties of United States of America (${date})", "type": "MAP" } ] @@ -333,13 +333,13 @@ "statVarKey": [ "Median_Income_Household_NonfamilyHousehold" ], - "title": "Nonfamily Household Median Income in Counties of United States (${date})", + "title": "Nonfamily Household Median Income in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Nonfamily Household Median Income in Counties of United States" + "title": "Nonfamily Household Median Income in Counties of United States of America" } ], "statVarSpec": { @@ -426,7 +426,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -434,7 +434,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/e2e_us_demo/howdoobesityratescomparewithratesofdiabetesinusacounties/chart_config.json b/server/integration_tests/test_data/e2e_us_demo/howdoobesityratescomparewithratesofdiabetesinusacounties/chart_config.json index 66bccf4e3a..48e3758a61 100644 --- a/server/integration_tests/test_data/e2e_us_demo/howdoobesityratescomparewithratesofdiabetesinusacounties/chart_config.json +++ b/server/integration_tests/test_data/e2e_us_demo/howdoobesityratescomparewithratesofdiabetesinusacounties/chart_config.json @@ -16,7 +16,7 @@ "Percent_Person_Obesity_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Prevalence of Obesity (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Prevalence of Obesity (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -32,7 +32,7 @@ "statVarKey": [ "Percent_Person_Obesity" ], - "title": "Prevalence of Obesity in Counties of United States (${date})", + "title": "Prevalence of Obesity in Counties of United States of America (${date})", "type": "MAP" } ] @@ -47,13 +47,13 @@ "statVarKey": [ "Percent_Person_Obesity" ], - "title": "Prevalence of Obesity in Counties of United States (${date})", + "title": "Prevalence of Obesity in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Prevalence of Obesity in Counties of United States" + "title": "Prevalence of Obesity in Counties of United States of America" }, { "columns": [ @@ -63,7 +63,7 @@ "statVarKey": [ "Percent_Person_WithDiabetes" ], - "title": "Diabetes in Counties of United States (${date})", + "title": "Diabetes in Counties of United States of America (${date})", "type": "MAP" } ] @@ -78,13 +78,13 @@ "statVarKey": [ "Percent_Person_WithDiabetes" ], - "title": "Diabetes in Counties of United States (${date})", + "title": "Diabetes in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Diabetes in Counties of United States" + "title": "Diabetes in Counties of United States of America" }, { "columns": [ @@ -98,7 +98,7 @@ "dc/4lvmzr1h1ylk1_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Prevalence: Female, Obesity (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Prevalence: Female, Obesity (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -114,7 +114,7 @@ "statVarKey": [ "dc/4lvmzr1h1ylk1" ], - "title": "Prevalence: Female, Obesity in Counties of United States (${date})", + "title": "Prevalence: Female, Obesity in Counties of United States of America (${date})", "type": "MAP" } ] @@ -129,13 +129,13 @@ "statVarKey": [ "dc/4lvmzr1h1ylk1" ], - "title": "Prevalence: Female, Obesity in Counties of United States (${date})", + "title": "Prevalence: Female, Obesity in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Prevalence: Female, Obesity in Counties of United States" + "title": "Prevalence: Female, Obesity in Counties of United States of America" }, { "columns": [ @@ -149,7 +149,7 @@ "dc/x13tvt8jsgrm4_scatter", "Percent_Person_WithDiabetes_scatter" ], - "title": "Prevalence: Male, Obesity (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States", + "title": "Prevalence: Male, Obesity (${yDate}) Vs. Diabetes (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -167,7 +167,7 @@ "statVarKey": [ "dc/x13tvt8jsgrm4" ], - "title": "Prevalence: Male, Obesity in Counties of United States (${date})", + "title": "Prevalence: Male, Obesity in Counties of United States of America (${date})", "type": "MAP" } ] @@ -182,13 +182,13 @@ "statVarKey": [ "dc/x13tvt8jsgrm4" ], - "title": "Prevalence: Male, Obesity in Counties of United States (${date})", + "title": "Prevalence: Male, Obesity in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Prevalence: Male, Obesity in Counties of United States" + "title": "Prevalence: Male, Obesity in Counties of United States of America" } ], "statVarSpec": { @@ -249,7 +249,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -257,7 +257,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/e2e_us_demo/whichcountiesintheushavethehighestlevelsofdiabetes/chart_config.json b/server/integration_tests/test_data/e2e_us_demo/whichcountiesintheushavethehighestlevelsofdiabetes/chart_config.json index 5b56b09478..8d4fe1b870 100644 --- a/server/integration_tests/test_data/e2e_us_demo/whichcountiesintheushavethehighestlevelsofdiabetes/chart_config.json +++ b/server/integration_tests/test_data/e2e_us_demo/whichcountiesintheushavethehighestlevelsofdiabetes/chart_config.json @@ -16,7 +16,7 @@ "statVarKey": [ "Percent_Person_WithDiabetes" ], - "title": "Diabetes in Counties of United States (${date})", + "title": "Diabetes in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -27,13 +27,13 @@ "statVarKey": [ "Percent_Person_WithDiabetes" ], - "title": "Diabetes in Counties of United States (${date})", + "title": "Diabetes in Counties of United States of America (${date})", "type": "MAP" } ] } ], - "title": "Diabetes in Counties of United States" + "title": "Diabetes in Counties of United States of America" }, { "columns": [ @@ -43,7 +43,7 @@ "statVarKey": [ "Percent_Person_WithDiabetes" ], - "title": "Diabetes in United States", + "title": "Diabetes in United States of America", "type": "LINE" } ] @@ -51,11 +51,11 @@ { "tiles": [ { - "description": "Diabetes in United States", + "description": "Diabetes in United States of America", "statVarKey": [ "Percent_Person_WithDiabetes" ], - "title": "Diabetes in United States", + "title": "Diabetes in United States of America", "type": "HIGHLIGHT" } ] @@ -75,7 +75,7 @@ "statVarKey": [ "Percent_Person_20OrMoreYears_WithDiabetes" ], - "title": "Percent of Population 20 Years or Older With Diabetes in Counties of United States (${date})", + "title": "Percent of Population 20 Years or Older With Diabetes in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -86,13 +86,13 @@ "statVarKey": [ "Percent_Person_20OrMoreYears_WithDiabetes" ], - "title": "Percent of Population 20 Years or Older With Diabetes in Counties of United States (${date})", + "title": "Percent of Population 20 Years or Older With Diabetes in Counties of United States of America (${date})", "type": "MAP" } ] } ], - "title": "Percent of Population 20 Years or Older With Diabetes in Counties of United States" + "title": "Percent of Population 20 Years or Older With Diabetes in Counties of United States of America" }, { "columns": [ @@ -106,7 +106,7 @@ "statVarKey": [ "dc/xmpy89x1nh8cg" ], - "title": "Percent of Men That Have Diabetes in Counties of United States (${date})", + "title": "Percent of Men That Have Diabetes in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -117,14 +117,14 @@ "statVarKey": [ "dc/xmpy89x1nh8cg" ], - "title": "Percent of Men That Have Diabetes in Counties of United States (${date})", + "title": "Percent of Men That Have Diabetes in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Percent of Men That Have Diabetes in Counties of United States" + "title": "Percent of Men That Have Diabetes in Counties of United States of America" }, { "columns": [ @@ -138,7 +138,7 @@ "statVarKey": [ "dc/nh3s4skee5483" ], - "title": "Percent of Women That Have Diabetes in Counties of United States (${date})", + "title": "Percent of Women That Have Diabetes in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -149,14 +149,14 @@ "statVarKey": [ "dc/nh3s4skee5483" ], - "title": "Percent of Women That Have Diabetes in Counties of United States (${date})", + "title": "Percent of Women That Have Diabetes in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Percent of Women That Have Diabetes in Counties of United States" + "title": "Percent of Women That Have Diabetes in Counties of United States of America" } ], "statVarSpec": { @@ -196,7 +196,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -204,7 +204,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/explore_strict_multi_var/chart_config.json b/server/integration_tests/test_data/explore_strict_multi_var/chart_config.json index df3ee8049a..e2491ce821 100644 --- a/server/integration_tests/test_data/explore_strict_multi_var/chart_config.json +++ b/server/integration_tests/test_data/explore_strict_multi_var/chart_config.json @@ -16,7 +16,7 @@ "Percent_Person_Obesity_scatter", "Percent_Person_SleepLessThan7Hours_scatter" ], - "title": "Prevalence of Obesity (${yDate}) Vs. Percentage That Sleeps Less Than 7 Hours Per Night (${xDate}) in Counties of United States", + "title": "Prevalence of Obesity (${yDate}) Vs. Percentage That Sleeps Less Than 7 Hours Per Night (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -32,7 +32,7 @@ "statVarKey": [ "Percent_Person_Obesity" ], - "title": "Prevalence of Obesity in Counties of United States (${date})", + "title": "Prevalence of Obesity in Counties of United States of America (${date})", "type": "MAP" } ] @@ -47,13 +47,13 @@ "statVarKey": [ "Percent_Person_Obesity" ], - "title": "Prevalence of Obesity in Counties of United States (${date})", + "title": "Prevalence of Obesity in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Prevalence of Obesity in Counties of United States" + "title": "Prevalence of Obesity in Counties of United States of America" }, { "columns": [ @@ -63,7 +63,7 @@ "statVarKey": [ "Percent_Person_SleepLessThan7Hours" ], - "title": "Percentage That Sleeps Less Than 7 Hours Per Night in Counties of United States (${date})", + "title": "Percentage That Sleeps Less Than 7 Hours Per Night in Counties of United States of America (${date})", "type": "MAP" } ] @@ -78,13 +78,13 @@ "statVarKey": [ "Percent_Person_SleepLessThan7Hours" ], - "title": "Percentage That Sleeps Less Than 7 Hours Per Night in Counties of United States (${date})", + "title": "Percentage That Sleeps Less Than 7 Hours Per Night in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Percentage That Sleeps Less Than 7 Hours Per Night in Counties of United States" + "title": "Percentage That Sleeps Less Than 7 Hours Per Night in Counties of United States of America" }, { "columns": [ @@ -98,7 +98,7 @@ "dc/4lvmzr1h1ylk1_scatter", "Percent_Person_SleepLessThan7Hours_scatter" ], - "title": "Prevalence: Female, Obesity (${yDate}) Vs. Percentage That Sleeps Less Than 7 Hours Per Night (${xDate}) in Counties of United States", + "title": "Prevalence: Female, Obesity (${yDate}) Vs. Percentage That Sleeps Less Than 7 Hours Per Night (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -114,7 +114,7 @@ "statVarKey": [ "dc/4lvmzr1h1ylk1" ], - "title": "Prevalence: Female, Obesity in Counties of United States (${date})", + "title": "Prevalence: Female, Obesity in Counties of United States of America (${date})", "type": "MAP" } ] @@ -129,13 +129,13 @@ "statVarKey": [ "dc/4lvmzr1h1ylk1" ], - "title": "Prevalence: Female, Obesity in Counties of United States (${date})", + "title": "Prevalence: Female, Obesity in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Prevalence: Female, Obesity in Counties of United States" + "title": "Prevalence: Female, Obesity in Counties of United States of America" }, { "columns": [ @@ -149,7 +149,7 @@ "dc/x13tvt8jsgrm4_scatter", "Percent_Person_SleepLessThan7Hours_scatter" ], - "title": "Prevalence: Male, Obesity (${yDate}) Vs. Percentage That Sleeps Less Than 7 Hours Per Night (${xDate}) in Counties of United States", + "title": "Prevalence: Male, Obesity (${yDate}) Vs. Percentage That Sleeps Less Than 7 Hours Per Night (${xDate}) in Counties of United States of America", "type": "SCATTER" } ] @@ -166,7 +166,7 @@ "statVarKey": [ "dc/x13tvt8jsgrm4" ], - "title": "Prevalence: Male, Obesity in Counties of United States (${date})", + "title": "Prevalence: Male, Obesity in Counties of United States of America (${date})", "type": "MAP" } ] @@ -181,13 +181,13 @@ "statVarKey": [ "dc/x13tvt8jsgrm4" ], - "title": "Prevalence: Male, Obesity in Counties of United States (${date})", + "title": "Prevalence: Male, Obesity in Counties of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Prevalence: Male, Obesity in Counties of United States" + "title": "Prevalence: Male, Obesity in Counties of United States of America" } ], "statVarSpec": { @@ -248,7 +248,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -256,7 +256,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/place_detection_e2e_dc/query_2/chart_config.json b/server/integration_tests/test_data/place_detection_e2e_dc/query_2/chart_config.json index 2b096d0a1c..73d6d7ed21 100644 --- a/server/integration_tests/test_data/place_detection_e2e_dc/query_2/chart_config.json +++ b/server/integration_tests/test_data/place_detection_e2e_dc/query_2/chart_config.json @@ -12,7 +12,7 @@ "statVarKey": [ "Median_Cost_HousingUnit_WithMortgage_OccupiedHousingUnit_OwnerOccupied_SelectedMonthlyOwnerCosts" ], - "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): With Mortgage in States of United States (${date})", + "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): With Mortgage in States of United States of America (${date})", "type": "MAP" } ] @@ -27,13 +27,13 @@ "statVarKey": [ "Median_Cost_HousingUnit_WithMortgage_OccupiedHousingUnit_OwnerOccupied_SelectedMonthlyOwnerCosts" ], - "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): With Mortgage in States of United States (${date})", + "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): With Mortgage in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): With Mortgage in States of United States" + "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): With Mortgage in States of United States of America" }, { "columns": [ @@ -43,7 +43,7 @@ "statVarKey": [ "Median_Cost_HousingUnit_WithoutMortgage_OccupiedHousingUnit_OwnerOccupied_SelectedMonthlyOwnerCosts" ], - "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): Without Mortgage in States of United States (${date})", + "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): Without Mortgage in States of United States of America (${date})", "type": "MAP" } ] @@ -58,13 +58,13 @@ "statVarKey": [ "Median_Cost_HousingUnit_WithoutMortgage_OccupiedHousingUnit_OwnerOccupied_SelectedMonthlyOwnerCosts" ], - "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): Without Mortgage in States of United States (${date})", + "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): Without Mortgage in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): Without Mortgage in States of United States" + "title": "Median Cost of Housing Unit (Selected Monthly Owner Costs): Without Mortgage in States of United States of America" }, { "columns": [ @@ -75,7 +75,7 @@ "Median_Cost_HousingUnit_WithMortgage_OccupiedHousingUnit_OwnerOccupied_SelectedMonthlyOwnerCosts", "Median_Cost_HousingUnit_WithoutMortgage_OccupiedHousingUnit_OwnerOccupied_SelectedMonthlyOwnerCosts" ], - "title": "Ownership Cost by Mortgage Status in United States", + "title": "Ownership Cost by Mortgage Status in United States of America", "type": "LINE" } ] @@ -91,7 +91,7 @@ "statVarKey": [ "Median_GrossRent_HousingUnit_WithCashRent_OccupiedHousingUnit_RenterOccupied" ], - "title": "Median Gross Rent of Housing Unit: With Cash Rent in States of United States (${date})", + "title": "Median Gross Rent of Housing Unit: With Cash Rent in States of United States of America (${date})", "type": "MAP" } ] @@ -106,13 +106,13 @@ "statVarKey": [ "Median_GrossRent_HousingUnit_WithCashRent_OccupiedHousingUnit_RenterOccupied" ], - "title": "Median Gross Rent of Housing Unit: With Cash Rent in States of United States (${date})", + "title": "Median Gross Rent of Housing Unit: With Cash Rent in States of United States of America (${date})", "type": "RANKING" } ] } ], - "title": "Median Gross Rent of Housing Unit: With Cash Rent in States of United States" + "title": "Median Gross Rent of Housing Unit: With Cash Rent in States of United States of America" }, { "columns": [ @@ -122,7 +122,7 @@ "statVarKey": [ "Median_GrossRent_HousingUnit_WithCashRent_OccupiedHousingUnit_RenterOccupied" ], - "title": "Median Gross Rent of Housing Unit: With Cash Rent in United States", + "title": "Median Gross Rent of Housing Unit: With Cash Rent in United States of America", "type": "LINE" } ] @@ -130,11 +130,11 @@ { "tiles": [ { - "description": "Median Gross Rent of Housing Unit: With Cash Rent in United States", + "description": "Median Gross Rent of Housing Unit: With Cash Rent in United States of America", "statVarKey": [ "Median_GrossRent_HousingUnit_WithCashRent_OccupiedHousingUnit_RenterOccupied" ], - "title": "Median Gross Rent of Housing Unit: With Cash Rent in United States", + "title": "Median Gross Rent of Housing Unit: With Cash Rent in United States of America", "type": "HIGHLIGHT" } ] @@ -150,7 +150,7 @@ "statVarKey": [ "Count_HousingUnit_WithRent_Upto100USDollar" ], - "title": "Count of Housing Unit: 100 USD or Less in States of United States (${date})", + "title": "Count of Housing Unit: 100 USD or Less in States of United States of America (${date})", "type": "MAP" } ] @@ -165,14 +165,14 @@ "statVarKey": [ "Count_HousingUnit_WithRent_Upto100USDollar" ], - "title": "Count of Housing Unit: 100 USD or Less in States of United States (${date})", + "title": "Count of Housing Unit: 100 USD or Less in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Count of Housing Unit: 100 USD or Less in States of United States" + "title": "Count of Housing Unit: 100 USD or Less in States of United States of America" }, { "columns": [ @@ -182,7 +182,7 @@ "statVarKey": [ "Count_HousingUnit_WithRent_100To149USDollar" ], - "title": "Count of Housing Unit: 100-149 USD in States of United States (${date})", + "title": "Count of Housing Unit: 100-149 USD in States of United States of America (${date})", "type": "MAP" } ] @@ -197,14 +197,14 @@ "statVarKey": [ "Count_HousingUnit_WithRent_100To149USDollar" ], - "title": "Count of Housing Unit: 100-149 USD in States of United States (${date})", + "title": "Count of Housing Unit: 100-149 USD in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Count of Housing Unit: 100-149 USD in States of United States" + "title": "Count of Housing Unit: 100-149 USD in States of United States of America" }, { "columns": [ @@ -245,7 +245,7 @@ "Count_HousingUnit_WithRent_3000To3499USDollar_multiple_place_bar_block", "Count_HousingUnit_WithRent_3500OrMoreUSDollar_multiple_place_bar_block" ], - "title": "Houses by Rental Amount in United States (${date})", + "title": "Houses by Rental Amount in United States of America (${date})", "type": "BAR" } ] @@ -262,7 +262,7 @@ "statVarKey": [ "Count_HousingUnit_HomeValueUpto10000USDollar" ], - "title": "Homes Valued at $10,000 or Less in States of United States (${date})", + "title": "Homes Valued at $10,000 or Less in States of United States of America (${date})", "type": "MAP" } ] @@ -277,14 +277,14 @@ "statVarKey": [ "Count_HousingUnit_HomeValueUpto10000USDollar" ], - "title": "Homes Valued at $10,000 or Less in States of United States (${date})", + "title": "Homes Valued at $10,000 or Less in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Homes Valued at $10,000 or Less in States of United States" + "title": "Homes Valued at $10,000 or Less in States of United States of America" }, { "columns": [ @@ -294,7 +294,7 @@ "statVarKey": [ "Count_HousingUnit_HomeValueUpto10000USDollar" ], - "title": "Homes Valued at $10,000 or Less in United States", + "title": "Homes Valued at $10,000 or Less in United States of America", "type": "LINE" } ] @@ -302,11 +302,11 @@ { "tiles": [ { - "description": "Homes Valued at $10,000 or Less in United States", + "description": "Homes Valued at $10,000 or Less in United States of America", "statVarKey": [ "Count_HousingUnit_HomeValueUpto10000USDollar" ], - "title": "Homes Valued at $10,000 or Less in United States", + "title": "Homes Valued at $10,000 or Less in United States of America", "type": "HIGHLIGHT" } ] @@ -323,7 +323,7 @@ "statVarKey": [ "Count_HousingUnit_HomeValueUpto49999USDollar" ], - "title": "Count of Housing Unit: 49,999 USD or Less in States of United States (${date})", + "title": "Count of Housing Unit: 49,999 USD or Less in States of United States of America (${date})", "type": "MAP" } ] @@ -338,14 +338,14 @@ "statVarKey": [ "Count_HousingUnit_HomeValueUpto49999USDollar" ], - "title": "Count of Housing Unit: 49,999 USD or Less in States of United States (${date})", + "title": "Count of Housing Unit: 49,999 USD or Less in States of United States of America (${date})", "type": "RANKING" } ] } ], "denom": "Count_Person", - "title": "Count of Housing Unit: 49,999 USD or Less in States of United States" + "title": "Count of Housing Unit: 49,999 USD or Less in States of United States of America" }, { "columns": [ @@ -355,7 +355,7 @@ "statVarKey": [ "Count_HousingUnit_HomeValueUpto49999USDollar" ], - "title": "Count of Housing Unit: 49,999 USD or Less in United States", + "title": "Count of Housing Unit: 49,999 USD or Less in United States of America", "type": "LINE" } ] @@ -363,11 +363,11 @@ { "tiles": [ { - "description": "Count of Housing Unit: 49,999 USD or Less in United States", + "description": "Count of Housing Unit: 49,999 USD or Less in United States of America", "statVarKey": [ "Count_HousingUnit_HomeValueUpto49999USDollar" ], - "title": "Count of Housing Unit: 49,999 USD or Less in United States", + "title": "Count of Housing Unit: 49,999 USD or Less in United States of America", "type": "HIGHLIGHT" } ] @@ -524,7 +524,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -532,7 +532,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/place_detection_e2e_dc/query_2/debug_info.json b/server/integration_tests/test_data/place_detection_e2e_dc/query_2/debug_info.json index 0cd3d6b68f..4832845952 100644 --- a/server/integration_tests/test_data/place_detection_e2e_dc/query_2/debug_info.json +++ b/server/integration_tests/test_data/place_detection_e2e_dc/query_2/debug_info.json @@ -2,7 +2,7 @@ "places_detected": [ "us" ], - "places_resolved": "(name: United States, dcid: country/USA); ", + "places_resolved": "(name: United States of America, dcid: country/USA); ", "main_place_dcid": "country/USA", - "main_place_name": "United States" + "main_place_name": "United States of America" } \ No newline at end of file diff --git a/server/integration_tests/test_data/place_detection_e2e_dc/query_6/chart_config.json b/server/integration_tests/test_data/place_detection_e2e_dc/query_6/chart_config.json index d260f3d43f..4a0197c165 100644 --- a/server/integration_tests/test_data/place_detection_e2e_dc/query_6/chart_config.json +++ b/server/integration_tests/test_data/place_detection_e2e_dc/query_6/chart_config.json @@ -16,7 +16,7 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months" ], - "title": "Population Below Poverty Line in Counties of United States (${date})", + "title": "Population Below Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -27,14 +27,14 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months" ], - "title": "Population Below Poverty Line in Counties of United States (${date})", + "title": "Population Below Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Population Below Poverty Line in Counties of United States" + "title": "Population Below Poverty Line in Counties of United States of America" }, { "columns": [ @@ -44,7 +44,7 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months" ], - "title": "Population Below Poverty Line in United States", + "title": "Population Below Poverty Line in United States of America", "type": "LINE" } ] @@ -52,11 +52,11 @@ { "tiles": [ { - "description": "Population Below Poverty Line in United States", + "description": "Population Below Poverty Line in United States of America", "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months" ], - "title": "Population Below Poverty Line in United States", + "title": "Population Below Poverty Line in United States of America", "type": "HIGHLIGHT" } ] @@ -77,7 +77,7 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months_AsFractionOf_Count_Person" ], - "title": "Population Below Poverty Line (Per Capita) in Counties of United States (${date})", + "title": "Population Below Poverty Line (Per Capita) in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -88,13 +88,13 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months_AsFractionOf_Count_Person" ], - "title": "Population Below Poverty Line (Per Capita) in Counties of United States (${date})", + "title": "Population Below Poverty Line (Per Capita) in Counties of United States of America (${date})", "type": "MAP" } ] } ], - "title": "Population Below Poverty Line (Per Capita) in Counties of United States" + "title": "Population Below Poverty Line (Per Capita) in Counties of United States of America" }, { "columns": [ @@ -108,7 +108,7 @@ "statVarKey": [ "Count_Person_Female_BelowPovertyLevelInThePast12Months" ], - "title": "Women Below Poverty Line in Counties of United States (${date})", + "title": "Women Below Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -119,14 +119,14 @@ "statVarKey": [ "Count_Person_Female_BelowPovertyLevelInThePast12Months" ], - "title": "Women Below Poverty Line in Counties of United States (${date})", + "title": "Women Below Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Women Below Poverty Line in Counties of United States" + "title": "Women Below Poverty Line in Counties of United States of America" }, { "columns": [ @@ -140,7 +140,7 @@ "statVarKey": [ "Count_Person_Male_BelowPovertyLevelInThePast12Months" ], - "title": "Males in Poverty (In Last Year) in Counties of United States (${date})", + "title": "Males in Poverty (In Last Year) in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -151,14 +151,14 @@ "statVarKey": [ "Count_Person_Male_BelowPovertyLevelInThePast12Months" ], - "title": "Males in Poverty (In Last Year) in Counties of United States (${date})", + "title": "Males in Poverty (In Last Year) in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Males in Poverty (In Last Year) in Counties of United States" + "title": "Males in Poverty (In Last Year) in Counties of United States of America" }, { "columns": [ @@ -169,7 +169,7 @@ "Count_Person_Female_BelowPovertyLevelInThePast12Months", "Count_Person_Male_BelowPovertyLevelInThePast12Months" ], - "title": "Impoverished Population by Gender in United States", + "title": "Impoverished Population by Gender in United States of America", "type": "LINE" } ] @@ -190,7 +190,7 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months_AsianAlone" ], - "title": "Asians Below Poverty Line in Counties of United States (${date})", + "title": "Asians Below Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -201,14 +201,14 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months_AsianAlone" ], - "title": "Asians Below Poverty Line in Counties of United States (${date})", + "title": "Asians Below Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Asians Below Poverty Line in Counties of United States" + "title": "Asians Below Poverty Line in Counties of United States of America" }, { "columns": [ @@ -222,7 +222,7 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months_BlackOrAfricanAmericanAlone" ], - "title": "Black or African Americans Below Poverty in Counties of United States (${date})", + "title": "Black or African Americans Below Poverty in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -233,14 +233,14 @@ "statVarKey": [ "Count_Person_BelowPovertyLevelInThePast12Months_BlackOrAfricanAmericanAlone" ], - "title": "Black or African Americans Below Poverty in Counties of United States (${date})", + "title": "Black or African Americans Below Poverty in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Black or African Americans Below Poverty in Counties of United States" + "title": "Black or African Americans Below Poverty in Counties of United States of America" }, { "columns": [ @@ -265,7 +265,7 @@ "Count_Person_BelowPovertyLevelInThePast12Months_WhiteAlone_multiple_place_bar_block", "Count_Person_BelowPovertyLevelInThePast12Months_WhiteAloneNotHispanicOrLatino_multiple_place_bar_block" ], - "title": "Impoverished Population by Race in United States (${date})", + "title": "Impoverished Population by Race in United States of America (${date})", "type": "BAR" } ] @@ -286,7 +286,7 @@ "statVarKey": [ "Count_Person_5OrMoreYears_LanguageOtherThanEnglishSpokenAtHome_BelowPovertyLevelInThePast12Months" ], - "title": "Population: Some Language Other Than English Spoken at Home & Below Poverty Line in Counties of United States (${date})", + "title": "Population: Some Language Other Than English Spoken at Home & Below Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -297,14 +297,14 @@ "statVarKey": [ "Count_Person_5OrMoreYears_LanguageOtherThanEnglishSpokenAtHome_BelowPovertyLevelInThePast12Months" ], - "title": "Population: Some Language Other Than English Spoken at Home & Below Poverty Line in Counties of United States (${date})", + "title": "Population: Some Language Other Than English Spoken at Home & Below Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Population: Some Language Other Than English Spoken at Home & Below Poverty Line in Counties of United States" + "title": "Population: Some Language Other Than English Spoken at Home & Below Poverty Line in Counties of United States of America" }, { "columns": [ @@ -318,7 +318,7 @@ "statVarKey": [ "Count_Person_5OrMoreYears_OnlyEnglishSpokenAtHome_BelowPovertyLevelInThePast12Months" ], - "title": "Population: Only English Spoken at Home, Below Poverty Line in Counties of United States (${date})", + "title": "Population: Only English Spoken at Home, Below Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -329,14 +329,14 @@ "statVarKey": [ "Count_Person_5OrMoreYears_OnlyEnglishSpokenAtHome_BelowPovertyLevelInThePast12Months" ], - "title": "Population: Only English Spoken at Home, Below Poverty Line in Counties of United States (${date})", + "title": "Population: Only English Spoken at Home, Below Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Population: Only English Spoken at Home, Below Poverty Line in Counties of United States" + "title": "Population: Only English Spoken at Home, Below Poverty Line in Counties of United States of America" }, { "columns": [ @@ -349,7 +349,7 @@ "Count_Person_5OrMoreYears_SpanishOrSpanishCreoleSpokenAtHome_BelowPovertyLevelInThePast12Months", "Count_Person_5OrMoreYears_SpanishSpokenAtHome_BelowPovertyLevelInThePast12Months" ], - "title": "Impoverished Population by By Language Spoken at Home in United States", + "title": "Impoverished Population by By Language Spoken at Home in United States of America", "type": "LINE" } ] @@ -366,7 +366,7 @@ "statVarKey": [ "sdg/SI_POV_DAY1" ], - "title": "Population Below International Poverty Line in United States", + "title": "Population Below International Poverty Line in United States of America", "type": "LINE" } ] @@ -374,11 +374,11 @@ { "tiles": [ { - "description": "Population Below International Poverty Line in United States", + "description": "Population Below International Poverty Line in United States of America", "statVarKey": [ "sdg/SI_POV_DAY1" ], - "title": "Population Below International Poverty Line in United States", + "title": "Population Below International Poverty Line in United States of America", "type": "HIGHLIGHT" } ] @@ -398,7 +398,7 @@ "statVarKey": [ "Count_Household_FamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Family Households Below the Poverty Line in Counties of United States (${date})", + "title": "Family Households Below the Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -409,14 +409,14 @@ "statVarKey": [ "Count_Household_FamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Family Households Below the Poverty Line in Counties of United States (${date})", + "title": "Family Households Below the Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Family Households Below the Poverty Line in Counties of United States" + "title": "Family Households Below the Poverty Line in Counties of United States of America" }, { "columns": [ @@ -426,7 +426,7 @@ "statVarKey": [ "Count_Household_FamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Family Households Below the Poverty Line in United States", + "title": "Family Households Below the Poverty Line in United States of America", "type": "LINE" } ] @@ -434,11 +434,11 @@ { "tiles": [ { - "description": "Family Households Below the Poverty Line in United States", + "description": "Family Households Below the Poverty Line in United States of America", "statVarKey": [ "Count_Household_FamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Family Households Below the Poverty Line in United States", + "title": "Family Households Below the Poverty Line in United States of America", "type": "HIGHLIGHT" } ] @@ -459,7 +459,7 @@ "statVarKey": [ "Count_Household_MarriedCoupleFamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Married Couple Family Households Below Poverty Line in Counties of United States (${date})", + "title": "Married Couple Family Households Below Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -470,14 +470,14 @@ "statVarKey": [ "Count_Household_MarriedCoupleFamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Married Couple Family Households Below Poverty Line in Counties of United States (${date})", + "title": "Married Couple Family Households Below Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Married Couple Family Households Below Poverty Line in Counties of United States" + "title": "Married Couple Family Households Below Poverty Line in Counties of United States of America" }, { "columns": [ @@ -487,7 +487,7 @@ "statVarKey": [ "Count_Household_MarriedCoupleFamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Married Couple Family Households Below Poverty Line in United States", + "title": "Married Couple Family Households Below Poverty Line in United States of America", "type": "LINE" } ] @@ -495,11 +495,11 @@ { "tiles": [ { - "description": "Married Couple Family Households Below Poverty Line in United States", + "description": "Married Couple Family Households Below Poverty Line in United States of America", "statVarKey": [ "Count_Household_MarriedCoupleFamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Married Couple Family Households Below Poverty Line in United States", + "title": "Married Couple Family Households Below Poverty Line in United States of America", "type": "HIGHLIGHT" } ] @@ -520,7 +520,7 @@ "statVarKey": [ "Count_Person_AbovePovertyLevelInThePast12Months" ], - "title": "Population Above Poverty Line in Counties of United States (${date})", + "title": "Population Above Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -531,14 +531,14 @@ "statVarKey": [ "Count_Person_AbovePovertyLevelInThePast12Months" ], - "title": "Population Above Poverty Line in Counties of United States (${date})", + "title": "Population Above Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Population Above Poverty Line in Counties of United States" + "title": "Population Above Poverty Line in Counties of United States of America" }, { "columns": [ @@ -548,7 +548,7 @@ "statVarKey": [ "Count_Person_AbovePovertyLevelInThePast12Months" ], - "title": "Population Above Poverty Line in United States", + "title": "Population Above Poverty Line in United States of America", "type": "LINE" } ] @@ -556,11 +556,11 @@ { "tiles": [ { - "description": "Population Above Poverty Line in United States", + "description": "Population Above Poverty Line in United States of America", "statVarKey": [ "Count_Person_AbovePovertyLevelInThePast12Months" ], - "title": "Population Above Poverty Line in United States", + "title": "Population Above Poverty Line in United States of America", "type": "HIGHLIGHT" } ] @@ -581,7 +581,7 @@ "statVarKey": [ "Count_Household_HouseholderAge65OrMoreYears_FamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in Counties of United States (${date})", + "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -592,14 +592,14 @@ "statVarKey": [ "Count_Household_HouseholderAge65OrMoreYears_FamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in Counties of United States (${date})", + "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in Counties of United States" + "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in Counties of United States of America" }, { "columns": [ @@ -609,7 +609,7 @@ "statVarKey": [ "Count_Household_HouseholderAge65OrMoreYears_FamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in United States", + "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in United States of America", "type": "LINE" } ] @@ -617,11 +617,11 @@ { "tiles": [ { - "description": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in United States", + "description": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in United States of America", "statVarKey": [ "Count_Household_HouseholderAge65OrMoreYears_FamilyHousehold_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in United States", + "title": "Count of Household: Family Household, 65 Years or More, Below Poverty Level in the Past 12 Months in United States of America", "type": "HIGHLIGHT" } ] @@ -642,7 +642,7 @@ "statVarKey": [ "Count_Person_Male_AbovePovertyLevelInThePast12Months" ], - "title": "Men Above Poverty Line in Counties of United States (${date})", + "title": "Men Above Poverty Line in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -653,14 +653,14 @@ "statVarKey": [ "Count_Person_Male_AbovePovertyLevelInThePast12Months" ], - "title": "Men Above Poverty Line in Counties of United States (${date})", + "title": "Men Above Poverty Line in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Men Above Poverty Line in Counties of United States" + "title": "Men Above Poverty Line in Counties of United States of America" }, { "columns": [ @@ -670,7 +670,7 @@ "statVarKey": [ "Count_Person_Male_AbovePovertyLevelInThePast12Months" ], - "title": "Men Above Poverty Line in United States", + "title": "Men Above Poverty Line in United States of America", "type": "LINE" } ] @@ -678,11 +678,11 @@ { "tiles": [ { - "description": "Men Above Poverty Line in United States", + "description": "Men Above Poverty Line in United States of America", "statVarKey": [ "Count_Person_Male_AbovePovertyLevelInThePast12Months" ], - "title": "Men Above Poverty Line in United States", + "title": "Men Above Poverty Line in United States of America", "type": "HIGHLIGHT" } ] @@ -703,7 +703,7 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With0Worker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in Counties of United States (${date})", + "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -714,14 +714,14 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With0Worker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in Counties of United States (${date})", + "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in Counties of United States" + "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in Counties of United States of America" }, { "columns": [ @@ -731,7 +731,7 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With0Worker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in United States", + "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in United States of America", "type": "LINE" } ] @@ -739,11 +739,11 @@ { "tiles": [ { - "description": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in United States", + "description": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in United States of America", "statVarKey": [ "Count_Household_FamilyHousehold_With0Worker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in United States", + "title": "Count of Household: Family Household, Worker 0, Below Poverty Level in the Past 12 Months in United States of America", "type": "HIGHLIGHT" } ] @@ -764,7 +764,7 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With2Worker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in Counties of United States (${date})", + "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -775,14 +775,14 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With2Worker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in Counties of United States (${date})", + "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in Counties of United States" + "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in Counties of United States of America" }, { "columns": [ @@ -792,7 +792,7 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With2Worker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in United States", + "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in United States of America", "type": "LINE" } ] @@ -800,11 +800,11 @@ { "tiles": [ { - "description": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in United States", + "description": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in United States of America", "statVarKey": [ "Count_Household_FamilyHousehold_With2Worker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in United States", + "title": "Count of Household: Family Household, Worker 2, Below Poverty Level in the Past 12 Months in United States of America", "type": "HIGHLIGHT" } ] @@ -825,7 +825,7 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With3OrMoreWorker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in Counties of United States (${date})", + "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in Counties of United States of America (${date})", "type": "RANKING" } ] @@ -836,14 +836,14 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With3OrMoreWorker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in Counties of United States (${date})", + "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in Counties of United States of America (${date})", "type": "MAP" } ] } ], "denom": "Count_Person", - "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in Counties of United States" + "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in Counties of United States of America" }, { "columns": [ @@ -853,7 +853,7 @@ "statVarKey": [ "Count_Household_FamilyHousehold_With3OrMoreWorker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in United States", + "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in United States of America", "type": "LINE" } ] @@ -861,11 +861,11 @@ { "tiles": [ { - "description": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in United States", + "description": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in United States of America", "statVarKey": [ "Count_Household_FamilyHousehold_With3OrMoreWorker_BelowPovertyLevelInThePast12Months" ], - "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in United States", + "title": "Count of Household: Family Household, 3 Worker or More, Below Poverty Level in the Past 12 Months in United States of America", "type": "HIGHLIGHT" } ] @@ -1002,7 +1002,7 @@ "pastSourceContext": "", "place": { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" }, "placeFallback": {}, @@ -1010,7 +1010,7 @@ "places": [ { "dcid": "country/USA", - "name": "United States", + "name": "United States of America", "place_type": "Country" } ], diff --git a/server/integration_tests/test_data/place_detection_e2e_dc/query_6/debug_info.json b/server/integration_tests/test_data/place_detection_e2e_dc/query_6/debug_info.json index 0cd3d6b68f..4832845952 100644 --- a/server/integration_tests/test_data/place_detection_e2e_dc/query_6/debug_info.json +++ b/server/integration_tests/test_data/place_detection_e2e_dc/query_6/debug_info.json @@ -2,7 +2,7 @@ "places_detected": [ "us" ], - "places_resolved": "(name: United States, dcid: country/USA); ", + "places_resolved": "(name: United States of America, dcid: country/USA); ", "main_place_dcid": "country/USA", - "main_place_name": "United States" + "main_place_name": "United States of America" } \ No newline at end of file From 1f447225bfdfd38105fac5bb70e020de6990ee0f Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 12:00:09 +0530 Subject: [PATCH 16/23] Fix: remove unused json import in migration_verification_test.py --- server/tests/migration_verification_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/server/tests/migration_verification_test.py b/server/tests/migration_verification_test.py index 83b832c1ef..34b7da4dcb 100644 --- a/server/tests/migration_verification_test.py +++ b/server/tests/migration_verification_test.py @@ -1,4 +1,3 @@ -import json import unittest from unittest.mock import patch From cd17e6305c39e3b6b00318c8dc5d6abdde95fed5 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 12:08:46 +0530 Subject: [PATCH 17/23] Refactor: remove unused endpoints and move PLACE_TYPE_RANK to constants --- server/services/datacommons.py | 26 +------------------------- server/services/discovery.py | 2 -- shared/lib/constants.py | 27 +++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index f1a87e2289..36fed0b4f6 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -35,6 +35,7 @@ from server.services.discovery import get_service_url from shared.lib.constants import MIXER_RESPONSE_ID_FIELD from shared.lib.constants import MIXER_RESPONSE_ID_HEADER +from shared.lib.constants import PLACE_TYPE_RANK from shared.lib.constants import SURFACE_HEADER_NAME from shared.lib.constants import UNKNOWN_SURFACE @@ -401,31 +402,6 @@ def get_variable_ancestors(dcid: str): return get(url).get("ancestors", []) -PLACE_TYPE_RANK = { - "CensusZipCodeTabulationArea": 1, - "AdministrativeArea5": 2, - "AdministrativeArea4": 2, - "Village": 5, - "City": 5, - "Town": 5, - "Borough": 5, - "AdministrativeArea3": 5, - "County": 10, - "AdministrativeArea2": 10, - "EurostatNUTS3": 10, - "CensusDivision": 15, - "State": 20, - "AdministrativeArea1": 20, - "EurostatNUTS2": 20, - "EurostatNUTS1": 20, - "Country": 30, - "CensusRegion": 35, - "GeoRegion": 38, - "Continent": 40, - "Place": 50, -} - - def get_place_info(dcids: List[str]) -> Dict: """Retrieves Place Info given a list of DCIDs.""" # Get ancestors using BFS since v2/node doesn't support recursive ->containedInPlace+ diff --git a/server/services/discovery.py b/server/services/discovery.py index c97d6a101d..5bec8a6b87 100644 --- a/server/services/discovery.py +++ b/server/services/discovery.py @@ -134,10 +134,8 @@ def get_service_url(self, endpoint_path: str) -> str: '/translate', '/search', # v1 - '/v1/bulk/info/place', '/v1/bulk/info/variable', '/v1/bulk/info/variable-group', - '/v1/bulk/observation-dates/linked', '/v1/variable/ancestors', '/v1/place/ranking', '/v1/place/related', diff --git a/shared/lib/constants.py b/shared/lib/constants.py index 14ff10b9e7..70e9496c4c 100644 --- a/shared/lib/constants.py +++ b/shared/lib/constants.py @@ -475,3 +475,30 @@ # Flask App env config constants LOG_EXTREME_MIXER_CALLS = "LOG_EXTREME_MIXER_CALLS" LOG_CACHED_MIXER_RESPONSE_USAGE = "LOG_CACHED_MIXER_RESPONSE_USAGE" + +# Rank for sorting parents (City -> State -> Country) +# The values are arbitrary and relative, used only to establish +# a topological order (smaller number = "smaller" child place). +PLACE_TYPE_RANK = { + "CensusZipCodeTabulationArea": 1, + "AdministrativeArea5": 2, + "AdministrativeArea4": 2, + "Village": 5, + "City": 5, + "Town": 5, + "Borough": 5, + "AdministrativeArea3": 5, + "County": 10, + "AdministrativeArea2": 10, + "EurostatNUTS3": 10, + "CensusDivision": 15, + "State": 20, + "AdministrativeArea1": 20, + "EurostatNUTS2": 20, + "EurostatNUTS1": 20, + "Country": 30, + "CensusRegion": 35, + "GeoRegion": 38, + "Continent": 40, + "Place": 50, +} From 8e760dc0a3058647e93479cfa106e6093a8bba9d Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 12:10:04 +0530 Subject: [PATCH 18/23] Fix: remove unused variable 'ent' in get_series_dates --- server/services/datacommons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 36fed0b4f6..08ea25e695 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -574,7 +574,7 @@ def get_series_dates(parent_entity, child_type, variables): for var, var_data in by_var.items(): by_ent = var_data.get('byEntity', {}) - for ent, ent_data in by_ent.items(): + for _, ent_data in by_ent.items(): series = ent_data.get('series', []) for obs in series: From 6d7058e4a6a85a233e3bdc2701696195251892b7 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 12:22:35 +0530 Subject: [PATCH 19/23] Refactor: apply minor cleanups in datacommons.py --- server/services/datacommons.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 08ea25e695..aad2dd47f2 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -412,8 +412,8 @@ def get_place_info(dcids: List[str]) -> Dict: visited = set() # BFS to build parent graph (max depth 10) - MAX_ANCESTOR_DEPTH = 10 - for _ in range(MAX_ANCESTOR_DEPTH): + max_ancestor_depth = 10 + for _ in range(max_ancestor_depth): if not frontier: break @@ -461,7 +461,7 @@ def get_place_info(dcids: List[str]) -> Dict: all_dcids.update(anc_set) all_dcids.update(dcids) - all_dcids_list = sorted(list(all_dcids)) + all_dcids_list = sorted(all_dcids) if not all_dcids_list: return {'data': []} @@ -545,7 +545,6 @@ def get_series_dates(parent_entity, child_type, variables): # Get children recursively with type filter children_resp = v2node([parent_entity], f'<-containedInPlace+{{typeOf:{child_type}}}') - child_dcids = [] node_data = children_resp.get('data', {}).get(parent_entity, {}) # V2 response key for recursion includes the + but not the filter @@ -562,7 +561,6 @@ def get_series_dates(parent_entity, child_type, variables): entity={'dcids': child_dcids}, variable={'dcids': variables}) - # Aggregate results # Aggregate results: { variable: { date: { facet: count } } } agg_data = collections.defaultdict( lambda: collections.defaultdict(lambda: collections.defaultdict(int))) @@ -585,10 +583,6 @@ def get_series_dates(parent_entity, child_type, variables): # Facet handling facet_id = obs.get('facet', "") agg_data[var][date][facet_id] += 1 - # Assuming facets details are in 'facets' key of response? - # v2observation response should have 'facets' top level key if requested? - # 'facet' in select might return the ID in the series or the object? - # Usually it returns facetID and a top-level facets map. # Construct response resp_dates = [] @@ -599,9 +593,7 @@ def get_series_dates(parent_entity, child_type, variables): for facet_id, count in facet_counts.items(): entity_counts.append({ "count": count, - "facet": facet_id # V1 expects facet ID or object? - # V1 proto: EntityCount { count, facet } where facet is string (ID?). - # But typically it might expect the full facet object in a separate map. + "facet": facet_id }) obs_dates.append({"date": date, "entityCount": entity_counts}) resp_dates.append({"variable": var, "observationDates": obs_dates}) From eddf2cfbfee781a7ded3f2a0b7dc7ab974d36ca6 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 12:42:35 +0530 Subject: [PATCH 20/23] Test: Update webdriver event page tests to expect United States of America --- server/webdriver/tests/event_page_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/webdriver/tests/event_page_test.py b/server/webdriver/tests/event_page_test.py index 3ae812cb5f..229349f967 100644 --- a/server/webdriver/tests/event_page_test.py +++ b/server/webdriver/tests/event_page_test.py @@ -55,7 +55,7 @@ def test_page_cyclone(self): self.assertEqual(find_elem(div1, by=By.TAG_NAME, value='h1').text, 'Nicole') self.assertEqual( find_elem(div1, by=By.TAG_NAME, value='h3').text, - 'Cyclone Event in Indian River County, Florida, United States, North America, Earth' + 'Cyclone Event in Indian River County, Florida, United States of America, North America, Earth' ) # Check the Google Map section @@ -114,7 +114,7 @@ def test_page_fire(self): '0003 Fire 2015 (2836427)') self.assertEqual( find_elem(div1, by=By.TAG_NAME, value='h3').text, - 'Wildland Fire Event in Deschutes County, Oregon, United States, North America, Earth' + 'Wildland Fire Event in Deschutes County, Oregon, United States of America, North America, Earth' ) # Check google map section @@ -169,7 +169,7 @@ def test_page_drought(self): 'stormEvent/nws5512667') self.assertEqual( find_elem(div1, by=By.TAG_NAME, value='h3').text, - 'Drought Event in Hood County, Texas, United States, North America, Earth' + 'Drought Event in Hood County, Texas, United States of America, North America, Earth' ) # Check google map section From 908c4a7eb42daca5d5fd82a4066b086cff09a63c Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 14:13:41 +0530 Subject: [PATCH 21/23] Fix: Python style formatting in get_series_dates --- server/services/datacommons.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index aad2dd47f2..8ac850ca0a 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -591,10 +591,7 @@ def get_series_dates(parent_entity, child_type, variables): for date, facet_counts in dates_map.items(): entity_counts = [] for facet_id, count in facet_counts.items(): - entity_counts.append({ - "count": count, - "facet": facet_id - }) + entity_counts.append({"count": count, "facet": facet_id}) obs_dates.append({"date": date, "entityCount": entity_counts}) resp_dates.append({"variable": var, "observationDates": obs_dates}) From cc0afe3a5e4f286d74044f14d7ad460318e4be57 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 14:45:16 +0530 Subject: [PATCH 22/23] Optimize: remove unused 'value' from v2observation in get_series_dates --- server/services/datacommons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index 8ac850ca0a..bddddeb536 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -557,7 +557,7 @@ def get_series_dates(parent_entity, child_type, variables): # Get observation dates for the filtered children obs_resp = v2observation( - select=['date', 'variable', 'entity', 'value', 'facet'], + select=['date', 'variable', 'entity', 'facet'], entity={'dcids': child_dcids}, variable={'dcids': variables}) From 26c1c55545600fc197a562231b357b7c41f073e0 Mon Sep 17 00:00:00 2001 From: Sandeep Tuniki Date: Wed, 18 Mar 2026 15:13:31 +0530 Subject: [PATCH 23/23] Fix: apply Python style formatting for v2observation call --- server/services/datacommons.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/services/datacommons.py b/server/services/datacommons.py index bddddeb536..2e602b9b7e 100644 --- a/server/services/datacommons.py +++ b/server/services/datacommons.py @@ -556,10 +556,9 @@ def get_series_dates(parent_entity, child_type, variables): return {"datesByVariable": [], "facets": {}} # Get observation dates for the filtered children - obs_resp = v2observation( - select=['date', 'variable', 'entity', 'facet'], - entity={'dcids': child_dcids}, - variable={'dcids': variables}) + obs_resp = v2observation(select=['date', 'variable', 'entity', 'facet'], + entity={'dcids': child_dcids}, + variable={'dcids': variables}) # Aggregate results: { variable: { date: { facet: count } } } agg_data = collections.defaultdict(