You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\notebook_analytics\nemawashi\nemawashi_lib\user_interfaces\jobs.pyinadd_jobs_to_qgrid_widget(self, job)
340empty_row.append((column_name, ''))
341print(empty_row)
-->342self.widgets['jobs_qgrid'].add_row(empty_row)
343jobs_df=self.widgets['jobs_qgrid'].df344 (col_opts, col_defs) =self.__fetch_qgrid_options()
~\Anaconda3\envs\nemawashi\lib\site-packages\qgrid\grid.pyinadd_row(self, row)
1617added_index=self._duplicate_last_row()
1618else:
->1619added_index=self._add_row(row)
16201621self._notify_listeners({
~\Anaconda3\envs\nemawashi\lib\site-packages\qgrid\grid.pyin_add_row(self, row)
1666print(f"dictrow={dict(row)}")
1667print(f"indexname={df.index.name}")
->1668index_col_val=dict(row)[df.index.name]
16691670# check that the given column names match whatKeyError: None
The issue here is that the documentation says the following for the _add_row function.
def_add_row(self, row):
""" Append a new row to the end of the DataFrame given a list of 2-tuples of (column name, column value). This method will work for DataFrames with arbitrary index types. """
However, the code actual assumes there is an index name set within the dataframe here. A dataframe with an integer index will not have an index name. Either the _add_row function needs to be re-written or an option could be added to the add_row function to add an empty row.
qgrid_widget.add_row(empty=True)
Adding an empty row is very easy regardless if there is an index or not.
Reproduction Steps
Create a qgrid widget with an integer index
Call the add_row function with a row argument
What steps have you taken to resolve this already?
The workaround for me is to add the empty row in pandas and then re-instantiate the qgrid widget.
Anything else?
Please advise on the PR direction folks want and I will create the PR.
The text was updated successfully, but these errors were encountered:
Environment
Description of Issue
I am trying to add an empty row at the end of my
qgrid
widget. The row argument is:The error is:
The issue here is that the documentation says the following for the
_add_row
function.However, the code actual assumes there is an index name set within the dataframe here. A dataframe with an integer index will not have an index name. Either the
_add_row
function needs to be re-written or an option could be added to theadd_row
function to add an empty row.Adding an empty row is very easy regardless if there is an index or not.
Reproduction Steps
add_row
function with a row argumentWhat steps have you taken to resolve this already?
The workaround for me is to add the empty row in pandas and then re-instantiate the
qgrid
widget.Anything else?
Please advise on the PR direction folks want and I will create the PR.
The text was updated successfully, but these errors were encountered: