Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi select filter #174

Closed

Conversation

JCZuurmond
Copy link
Member

@JCZuurmond JCZuurmond commented Jun 18, 2024

Resolves #169
Stacked on #150

Screenshot 2024-06-18 at 16 45 40

@JCZuurmond JCZuurmond requested a review from nfx June 18, 2024 14:58
@JCZuurmond JCZuurmond self-assigned this Jun 18, 2024
@JCZuurmond JCZuurmond changed the base branch from main to feat/create-table-from-query June 18, 2024 14:59
Copy link
Member Author

@JCZuurmond JCZuurmond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nfx : The filter needs some rethinking as in Lakeview this is another widget (not part of the the table). Filters can actually operate on multiple widgets if they use the same dataset, but we create a dataset and widget per query, so there would be a one-to-one relationship in our case.

src/databricks/labs/lsql/dashboards.py Outdated Show resolved Hide resolved
widget = Widget(name=f"{self._widget_metadata.id}_filter", queries=[named_query], spec=spec)
return widget

def _get_named_query(self, fields: list[Field], *, name: str = "main_query", disaggregated: bool = True) -> NamedQuery:
Copy link
Member Author

@JCZuurmond JCZuurmond Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not really do much anymore besides passing parameters

layout = Layout(widget=tile.widget, position=tile.position)
layouts.append(layout)
if isinstance(tile, QueryTile) and tile.filter is not None:
layout = Layout(widget=tile.filter, position=tile.position)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to figure out what to do with the filter position

@@ -377,6 +410,9 @@ def _get_layouts(widgets_metadata: list[WidgetMetadata]) -> list[Layout]:
placed_tile = tile.place_after(position)
layout = Layout(widget=placed_tile.widget, position=placed_tile.position)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nfx : Maybe we want to convert the widget on a tile to widgets. Might be useful in future cases, or at least for multiple filters (on different columns)

@@ -81,16 +83,18 @@ def __init__(
width: int = 0,
height: int = 0,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WidgetMetdata is not becoming accurate anymore. It would be TileMetadata

Base automatically changed from feat/create-table-from-query to feat/dashboard-as-code-for-ucx June 19, 2024 06:43
Copy link
Collaborator

@nfx nfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm to unblock further work

@JCZuurmond JCZuurmond force-pushed the feat/add-multi-select-filter branch from 68f524d to d4946b7 Compare June 20, 2024 06:39
@JCZuurmond
Copy link
Member Author

Preferences goes to #181

@JCZuurmond JCZuurmond closed this Jun 21, 2024
@nfx nfx deleted the feat/add-multi-select-filter branch July 30, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Filter dashboard widgets using multiple select
2 participants