Skip to content

Commit

Permalink
Fix KeyError in get_group (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkn authored May 22, 2024
1 parent f79af86 commit 3ff4c85
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/charty/table_adapters/pandas_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ def [](key)
when PyCall::Tuple
key
else
PyCall::Tuple.new(*Array(key))
key = Array(key)
if key.length == 1 && key[0].is_a?(Integer)
key[0]
else
PyCall::Tuple.new(*key)
end
end
Charty::Table.new(@groupby.get_group(key))
end
Expand Down

0 comments on commit 3ff4c85

Please sign in to comment.