Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanng-cognite committed Sep 26, 2022
1 parent 88b6a92 commit ce100cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cognite/client/_api/geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def aggregate_features(
filter: Optional[Dict[str, Any]] = None,
group_by: Sequence[str] = None,
order_by: Sequence[OrderSpec] = None,
aggregate_output: Dict[str, Any] = None,
output: Dict[str, Any] = None,
) -> FeatureAggregateList:
"""`Aggregate filtered features`
<https://docs.cognite.com/api/v1/#operation/aggregateFeatures>
Expand All @@ -781,7 +781,7 @@ def aggregate_features(
aggregates (Sequence[str]): list of aggregates to be calculated
group_by (Sequence[str]): list of properties to group by with
order_by (Sequence[OrderSpec]): the order specification
aggregate_output (Dict[str, Any]): the aggregate output
output (Dict[str, Any]): the aggregate output
Returns:
FeatureAggregateList: the filtered features
Expand Down Expand Up @@ -809,7 +809,7 @@ def aggregate_features(
... filter={"range": {"property": "temperature", "gt": 12.0}},
... group_by=["category"],
... order_by=[OrderSpec("category", "ASC")],
... aggregate_output={"min_temperature": {"min": {"property": "temperature"}},
... output={"min_temperature": {"min": {"property": "temperature"}},
... "max_temperature": {"max": {"property": "temperature"}}
... }
... )
Expand All @@ -829,7 +829,7 @@ def aggregate_features(
"aggregates": aggregates,
"groupBy": group_by,
"sort": order,
"output": aggregate_output,
"output": output,
},
)
return cls._load(res.json()["items"], cognite_client=self._cognite_client)
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_integration/test_api/test_geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,6 @@ def test_aggregate_output(self, cognite_client, test_feature_type, test_features
res = cognite_client.geospatial.aggregate_features(
feature_type_external_id=test_feature_type.external_id,
filter={"range": {"property": "temperature", "gt": 12.0, "lt": 13.0}},
aggregate_output={"count": {"count": {"property": "temperature"}}},
output={"count": {"count": {"property": "temperature"}}},
)
assert res[0].count == 1

0 comments on commit ce100cb

Please sign in to comment.