|
7 | 7 | from datacommons_client.endpoints.base import API |
8 | 8 | from datacommons_client.endpoints.base import Endpoint |
9 | 9 | from datacommons_client.endpoints.payloads import NodeRequestPayload |
10 | | -from datacommons_client.endpoints.payloads import normalize_properties_to_string |
| 10 | +from datacommons_client.endpoints.payloads import normalize_list_to_string |
11 | 11 | from datacommons_client.endpoints.response import NodeResponse |
12 | 12 | from datacommons_client.models.node import Name |
13 | 13 | from datacommons_client.models.node import Node |
@@ -115,10 +115,10 @@ def fetch( |
115 | 115 |
|
116 | 116 | # Create the payload |
117 | 117 | payload = NodeRequestPayload(node_dcids=node_dcids, |
118 | | - expression=expression).to_dict |
| 118 | + expression=expression).to_dict() |
119 | 119 |
|
120 | 120 | # Make the request and return the response. |
121 | | - return NodeResponse.from_json( |
| 121 | + return NodeResponse.model_validate( |
122 | 122 | self.post(payload, all_pages=all_pages, next_token=next_token)) |
123 | 123 |
|
124 | 124 | def fetch_property_labels( |
@@ -199,7 +199,7 @@ def fetch_property_values( |
199 | 199 | """ |
200 | 200 |
|
201 | 201 | # Normalize the input to a string (if it's a list), otherwise use the string as is. |
202 | | - properties = normalize_properties_to_string(properties) |
| 202 | + properties = normalize_list_to_string(properties) |
203 | 203 |
|
204 | 204 | # Construct the expression based on the direction and constraints. |
205 | 205 | direction = "->" if out else "<-" |
|
0 commit comments