Skip to content

Commit

Permalink
Fix: Changing pivot to pivot_table to support aggregation (#376)
Browse files Browse the repository at this point in the history
Explain what this PR does.

Changing pivot to pivot_table to support aggregation

---------

Signed-off-by: Nandita Koppisetty <[email protected]>
  • Loading branch information
nkoppisetty committed May 4, 2024
1 parent 141e9a0 commit 402aabf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions numalogic/connectors/druid/_druid.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,11 @@ def fetch(
if pivot:
pivoted_frames = []
for column in pivot.columns:
_df = df.pivot(
_df = df.pivot_table(
index=pivot.index,
columns=[column],
values=pivot.value,
aggfunc="sum"
)
pivoted_frames.append(_df)

Expand Down Expand Up @@ -304,10 +305,11 @@ def chunked_fetch(
if pivot:
pivoted_frames = []
for column in pivot.columns:
_df = df.pivot(
_df = df.pivot_table(
index=pivot.index,
columns=[column],
values=pivot.value,
aggfunc="sum"
)
pivoted_frames.append(_df)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "numalogic"
version = "0.9.1a9"
version = "0.9.1a10"
description = "Collection of operational Machine Learning models and tools."
authors = ["Numalogic Developers"]
packages = [{ include = "numalogic" }]
Expand Down

0 comments on commit 402aabf

Please sign in to comment.