Skip to content

Commit

Permalink
#726: fix for using hide_header_editor on dtale.show
Browse files Browse the repository at this point in the history
  • Loading branch information
aschonfeld committed Feb 2, 2023
1 parent 5179b5d commit 65b1c32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dtale/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,8 @@ def startup(
base_settings["nanDisplay"] = nan_display
if hide_shutdown is not None:
base_settings["hide_shutdown"] = hide_shutdown
if hide_header_editor is not None:
base_settings["hide_header_editor"] = hide_header_editor
if column_edit_options is not None:
base_settings["column_edit_options"] = column_edit_options
global_state.set_settings(data_id, base_settings)
Expand Down
13 changes: 11 additions & 2 deletions tests/dtale/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def test_startup(unittest):
test_data = pd.DataFrame([dict(date=pd.Timestamp("now"), security_id=1, foo=1.5)])
test_data = test_data.set_index(["date", "security_id"])
instance = views.startup(
URL, data_loader=lambda: test_data, sort=[("security_id", "ASC")]
URL,
data_loader=lambda: test_data,
sort=[("security_id", "ASC")],
hide_header_editor=True,
hide_shutdown=True,
)

pdt.assert_frame_equal(instance.data, test_data.reset_index())
Expand All @@ -69,7 +73,8 @@ def test_startup(unittest):
dict(
allow_cell_edits=True,
columnFormats={},
hide_shutdown=False,
hide_shutdown=True,
hide_header_editor=True,
locked=["date", "security_id"],
precision=2,
sortInfo=[("security_id", "ASC")],
Expand Down Expand Up @@ -120,6 +125,7 @@ def test_startup(unittest):
allow_cell_edits=False,
columnFormats={},
hide_shutdown=False,
hide_header_editor=False,
locked=[],
precision=6,
rangeHighlight=range_highlights,
Expand All @@ -140,6 +146,7 @@ def test_startup(unittest):
allow_cell_edits=True,
columnFormats={},
hide_shutdown=False,
hide_header_editor=False,
locked=["security_id"],
precision=2,
rangeHighlight=None,
Expand All @@ -161,6 +168,7 @@ def test_startup(unittest):
precision=2,
columnFormats={},
hide_shutdown=False,
hide_header_editor=False,
rangeHighlight=None,
backgroundMode=None,
verticalHeaders=False,
Expand All @@ -180,6 +188,7 @@ def test_startup(unittest):
precision=2,
columnFormats={},
hide_shutdown=False,
hide_header_editor=False,
rangeHighlight=None,
backgroundMode=None,
verticalHeaders=False,
Expand Down

0 comments on commit 65b1c32

Please sign in to comment.