Closed JCZuurmond closed 6 days ago
See test below:
def test_dashboards_creates_dashboard_with_id_collisions(tmp_path): ws = create_autospec(WorkspaceClient) dashboard_content = """ display_name: Id collisions tiles: counter: width: 10 """.lstrip() (tmp_path / "dashboard.yml").write_text(dashboard_content) (tmp_path / "counter.md").write_text("# Description") (tmp_path / "counter.sql").write_text("SELECT 100 AS count") (tmp_path / "header_overwrite.sql").write_text("-- --id counter\nSELECT 100 AS count") lakeview_dashboard = Dashboards(ws).create_dashboard(tmp_path) layout = lakeview_dashboard.pages[0].layout assert len(layout) == 3 assert all(l.position.width == 10 for l in layout) ws.assert_not_called()
How do we want to handle these collisions from a user perspective?
Considerations:
--id
With id collisions the metadata is applied to all tiles with the same id, which is confusing when the metadata is defined in file headers
_Originally posted by @JCZuurmond in https://github.com/databrickslabs/lsql/pull/198#discussion_r1654847452_
Resolved in #208
See test below:
How do we want to handle these collisions from a user perspective?
Considerations:
--id
specified in file header, but id collisions with markdown and sql files are allowed.With id collisions the metadata is applied to all tiles with the same id, which is confusing when the metadata is defined in file headers
_Originally posted by @JCZuurmond in https://github.com/databrickslabs/lsql/pull/198#discussion_r1654847452_