Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### Updates
* Add official support for Python 3.10 and 3.11

### Bug Fixes
* Support `ipywidgets==8.0.0`

## 0.20.1

### Bug Fixes
Expand Down
40 changes: 20 additions & 20 deletions autovizwidget/autovizwidget/tests/test_encodingwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,40 +59,40 @@ def test_encoding_with_all_none_doesnt_throw():
call(
description="X",
value=None,
options={
"date": "date",
"temp_diff": "temp_diff",
"-": None,
"buildingID": "buildingID",
},
options=[
("-", None),
("buildingID", "buildingID"),
("date", "date"),
("temp_diff", "temp_diff"),
],
)
in ipywidget_factory.get_dropdown.mock_calls
)
assert (
call(
description="Y",
value=None,
options={
"date": "date",
"temp_diff": "temp_diff",
"-": None,
"buildingID": "buildingID",
},
options=[
("-", None),
("buildingID", "buildingID"),
("date", "date"),
("temp_diff", "temp_diff"),
],
)
in ipywidget_factory.get_dropdown.mock_calls
)
assert (
call(
description="Func.",
value="none",
options={
"Max": "Max",
"Sum": "Sum",
"Avg": "Avg",
"-": "None",
"Min": "Min",
"Count": "Count",
},
options=[
("-", "None"),
("Avg", "Avg"),
("Min", "Min"),
("Max", "Max"),
("Sum", "Sum"),
("Count", "Count"),
],
)
in ipywidget_factory.get_dropdown.mock_calls
)
Expand Down
25 changes: 13 additions & 12 deletions autovizwidget/autovizwidget/widget/encodingwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ def __init__(
)

# X view
options_x_view = {text(i): text(i) for i in self.df.columns}
options_x_view["-"] = None
options_x_view = [(text(i), text(i)) for i in self.df.columns]
options_x_view.insert(0, ("-", None))
self.x_view = self.ipywidget_factory.get_dropdown(
options=options_x_view, description="X", value=self.encoding.x
)
self.x_view.on_trait_change(self._x_changed_callback, "value")
self.x_view.layout.width = "200px"

# Y
options_y_view = {text(i): text(i) for i in self.df.columns}
options_y_view["-"] = None
options_y_view = [(text(i), text(i)) for i in self.df.columns]
options_y_view.insert(0, ("-", None))
y_column_view = self.ipywidget_factory.get_dropdown(
options=options_y_view, description="Y", value=self.encoding.y
)
Expand All @@ -62,15 +62,16 @@ def __init__(

# Y aggregator
value_for_view = self._get_value_for_aggregation(self.encoding.y_aggregation)
options_y_agg_view = [
("-", Encoding.y_agg_none),
(Encoding.y_agg_avg, Encoding.y_agg_avg),
(Encoding.y_agg_min, Encoding.y_agg_min),
(Encoding.y_agg_max, Encoding.y_agg_max),
(Encoding.y_agg_sum, Encoding.y_agg_sum),
(Encoding.y_agg_count, Encoding.y_agg_count),
]
self.y_agg_view = self.ipywidget_factory.get_dropdown(
options={
"-": Encoding.y_agg_none,
Encoding.y_agg_avg: Encoding.y_agg_avg,
Encoding.y_agg_min: Encoding.y_agg_min,
Encoding.y_agg_max: Encoding.y_agg_max,
Encoding.y_agg_sum: Encoding.y_agg_sum,
Encoding.y_agg_count: Encoding.y_agg_count,
},
options=options_y_agg_view,
description="Func.",
value=value_for_view,
)
Expand Down
8 changes: 4 additions & 4 deletions sparkmagic/sparkmagic/controllerwidget/addendpointwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ def __init__(
auth_class = getattr(events_handler_module, class_name)
self.auth_instances[auth] = auth_class()

dropdown_options = [(k, v) for k, v in conf.authenticators().items()]
self.auth_type = self.ipywidget_factory.get_dropdown(
options=conf.authenticators(), description="Auth type:"
options=dropdown_options, description="Auth type:"
)

# combine all authentication instance's widgets into one list to pass to self.children.
Expand Down Expand Up @@ -89,9 +90,8 @@ def run(self):
raise

def _update_auth(self):
"""
Create an instance of the chosen auth type maps to in the config file.
"""
"""Create an instance of the chosen auth type maps to in the config
file."""
for widget in self.auth.widgets:
widget.layout.display = "none"
self.auth = self.auth_instances.get(self.auth_type.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def _get_default_endpoints():
return default_endpoints

def _refresh(self):
dropdown_options = [(k, v) for k, v in self.endpoints.items()]
self.endpoints_dropdown_widget = self.ipywidget_factory.get_dropdown(
description="Endpoint:", options=self.endpoints
description="Endpoint:", options=dropdown_options
)

self.manage_session = ManageSessionWidget(
Expand Down