Skip to content

Commit

Permalink
index_name as optional positional argument
Browse files Browse the repository at this point in the history
Signed-off-by: Itay Dafna <i.b.dafna@gmail.com>
  • Loading branch information
ibdafna committed Apr 29, 2022
1 parent 03404ca commit b019481
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ipydatagrid/datagrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,16 +359,12 @@ class DataGrid(DOMWidget):
{"area": "all", "padding": 30, "numCols": None}, allow_none=False
).tag(sync=True)

def __init__(self, dataframe, **kwargs):
def __init__(self, dataframe, index_name=None, **kwargs):
# Setting default index name if not explicitly
# set by the user.
if "index_name" in kwargs:
self._index_name = kwargs["index_name"]
else:
self._index_name = None

self._index_name = index_name
self.data = dataframe
super().__init__()
super().__init__(**kwargs)
self._cell_click_handlers = CallbackDispatcher()
self._cell_change_handlers = CallbackDispatcher()
self.on_msg(self.__handle_custom_msg)
Expand Down

0 comments on commit b019481

Please sign in to comment.