Skip to content

Commit

Permalink
Replace deprecated polars count with len
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Dec 13, 2024
1 parent 1af592d commit fc67cf4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies = [
"packaging",
"pandas",
"pluggy>=1.3.0",
"polars",
"polars>=1",
"psutil",
"pyarrow", # extra dependency for pandas (parquet)
"pydantic > 2, < 2.10",
Expand Down
2 changes: 1 addition & 1 deletion src/ert/gui/ertwidgets/models/ertsummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ def getParameters(self) -> tuple[list[str], int]:
def getObservations(self) -> list[ObservationCount]:
counts: list[ObservationCount] = []
for df in self.ert_config.observations.values():
counts.extend(df.group_by("observation_key").count().to_dicts()) # type: ignore
counts.extend(df.group_by("observation_key").len(name="count").to_dicts()) # type: ignore

return sorted(counts, key=lambda k: k["observation_key"].lower())

0 comments on commit fc67cf4

Please sign in to comment.