From bf52ed18afc0128584d458ec2b375abef1b27076 Mon Sep 17 00:00:00 2001 From: Joel Ostblom Date: Tue, 14 Nov 2023 12:33:02 -0800 Subject: [PATCH] Make facet error more informative (#3264) --- altair/vegalite/v5/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 56c540426..aff5d5fb5 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -2766,7 +2766,10 @@ def facet( # Remove "ignore" statement once Undefined is no longer typed as Any if self.data is Undefined: # type: ignore raise ValueError( - "Facet charts require data to be specified at the top level." + "Facet charts require data to be specified at the top level. " + "If you are trying to facet layered or concatenated charts, " + "ensure that the same data variable is passed to each chart " + "or specify the data inside the facet method instead." ) # ignore type as copy comes from another class self = self.copy(deep=False) # type: ignore[attr-defined]