From 84536fe5f7562b98e84119af7c77e8a6df0c89f4 Mon Sep 17 00:00:00 2001 From: kenshima Date: Tue, 17 Dec 2024 02:37:45 +0200 Subject: [PATCH 1/7] changed typecheck for list value to use isinstance instead of type --- dash/dash.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dash/dash.py b/dash/dash.py index 6e7a1d2e5d..e3426d08c3 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -634,6 +634,9 @@ def _layout_value(self): @layout.setter def layout(self, value): + if isinstance(value, list): + value = html.Div(value) + _validate.validate_layout_type(value) self._layout_is_function = callable(value) self._layout = value From 629ad06ea0aa1da3949114722f34856972616b44 Mon Sep 17 00:00:00 2001 From: kenshima Date: Wed, 8 Jan 2025 17:16:35 +0200 Subject: [PATCH 2/7] set layout to list if not list already, add to validation_list to pass id content check --- .gitignore | 2 ++ dash/dash.py | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index bcfe7ce877..e9dfd3526f 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,5 @@ VERSION.txt !components/dash-core-components/tests/integration/upload/upload-assets/upft001.csv !components/dash-table/tests/assets/*.csv !components/dash-table/tests/selenium/assets/*.csv +app.py +launch.json diff --git a/dash/dash.py b/dash/dash.py index 976154e772..48489bf072 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -719,9 +719,6 @@ def _layout_value(self): @layout.setter def layout(self, value): - if isinstance(value, list): - value = html.Div(value) - _validate.validate_layout_type(value) self._layout_is_function = callable(value) self._layout = value @@ -2277,17 +2274,21 @@ def update(pathname_, search_, **states): # Set validation_layout if not self.config.suppress_callback_exceptions: - self.validation_layout = html.Div( - [ - page["layout"]() if callable(page["layout"]) else page["layout"] - for page in _pages.PAGE_REGISTRY.values() - ] - + [ + layout = self.layout + if not isinstance(layout, list): + layout = [ # pylint: disable=not-callable self.layout() if callable(self.layout) else self.layout ] + + self.validation_layout = html.Div( + [ + page["layout"]() if callable(page["layout"]) else page["layout"] + for page in _pages.PAGE_REGISTRY.values() + ] + + layout ) if _ID_CONTENT not in self.validation_layout: raise Exception("`dash.page_container` not found in the layout") From 78c8a722bce29e9882828ee3f15c363cfd995c41 Mon Sep 17 00:00:00 2001 From: kenshima Date: Thu, 9 Jan 2025 22:16:03 +0200 Subject: [PATCH 3/7] removed app.py and launch.json from gitignore. --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index e9dfd3526f..bcfe7ce877 100644 --- a/.gitignore +++ b/.gitignore @@ -92,5 +92,3 @@ VERSION.txt !components/dash-core-components/tests/integration/upload/upload-assets/upft001.csv !components/dash-table/tests/assets/*.csv !components/dash-table/tests/selenium/assets/*.csv -app.py -launch.json From 35e742be154260263b30a5ece1bff1a40d734d42 Mon Sep 17 00:00:00 2001 From: kenshima Date: Tue, 17 Dec 2024 02:37:45 +0200 Subject: [PATCH 4/7] changed typecheck for list value to use isinstance instead of type --- dash/dash.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dash/dash.py b/dash/dash.py index d00a4bf2a5..bd0e6bdcd4 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -719,6 +719,9 @@ def _layout_value(self): @layout.setter def layout(self, value): + if isinstance(value, list): + value = html.Div(value) + _validate.validate_layout_type(value) self._layout_is_function = callable(value) self._layout = value From c86079a5cb1876dc32cad989bfd9bf5205c3b69f Mon Sep 17 00:00:00 2001 From: kenshima Date: Wed, 8 Jan 2025 17:16:35 +0200 Subject: [PATCH 5/7] set layout to list if not list already, add to validation_list to pass id content check --- .gitignore | 2 ++ dash/dash.py | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index bcfe7ce877..e9dfd3526f 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,5 @@ VERSION.txt !components/dash-core-components/tests/integration/upload/upload-assets/upft001.csv !components/dash-table/tests/assets/*.csv !components/dash-table/tests/selenium/assets/*.csv +app.py +launch.json diff --git a/dash/dash.py b/dash/dash.py index bd0e6bdcd4..6d5ef61e51 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -719,9 +719,6 @@ def _layout_value(self): @layout.setter def layout(self, value): - if isinstance(value, list): - value = html.Div(value) - _validate.validate_layout_type(value) self._layout_is_function = callable(value) self._layout = value @@ -2284,17 +2281,21 @@ def update(pathname_, search_, **states): # Set validation_layout if not self.config.suppress_callback_exceptions: - self.validation_layout = html.Div( - [ - page["layout"]() if callable(page["layout"]) else page["layout"] - for page in _pages.PAGE_REGISTRY.values() - ] - + [ + layout = self.layout + if not isinstance(layout, list): + layout = [ # pylint: disable=not-callable self.layout() if callable(self.layout) else self.layout ] + + self.validation_layout = html.Div( + [ + page["layout"]() if callable(page["layout"]) else page["layout"] + for page in _pages.PAGE_REGISTRY.values() + ] + + layout ) if _ID_CONTENT not in self.validation_layout: raise Exception("`dash.page_container` not found in the layout") From 06bcbfb25182a632e0c1287b3f1cb9c963c95f9c Mon Sep 17 00:00:00 2001 From: kenshima Date: Thu, 9 Jan 2025 22:16:03 +0200 Subject: [PATCH 6/7] removed app.py and launch.json from gitignore. --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index e9dfd3526f..bcfe7ce877 100644 --- a/.gitignore +++ b/.gitignore @@ -92,5 +92,3 @@ VERSION.txt !components/dash-core-components/tests/integration/upload/upload-assets/upft001.csv !components/dash-table/tests/assets/*.csv !components/dash-table/tests/selenium/assets/*.csv -app.py -launch.json From 01524d8286ab780edc9e5a3a941246cf5c079bfe Mon Sep 17 00:00:00 2001 From: kenshima Date: Mon, 17 Feb 2025 13:59:15 +0200 Subject: [PATCH 7/7] Trigger CI/CD pipeline after local testing.