Return numberMatched if in STA response (#1259)

Attempt to return `@iot.count` in included in response. Including the query param `'$count' = 'true'` is costly on the SensorThings API endpoint when accessing the Observations entity. Some STA endpoints are including the count as a default.
This commit is contained in:
Benjamin Webb
2023-06-06 17:42:58 -04:00
committed by GitHub
parent 10d33c4207
commit 7ccfded868
+5 -1
View File
@@ -249,9 +249,13 @@ class SensorThingsProvider(BaseProvider):
# Make features
response = self._get_response(url=self._url, params=params)
v = response.get('value')
matched = response.get('@iot.count')
if matched:
fc['numberMatched'] = matched
# Query if values are less than expected
v = response.get('value')
while len(v) < limit:
try:
LOGGER.debug('Fetching next set of values')