From 10cf5919a5a9c3c38040fe2694872b4bbd8b4f87 Mon Sep 17 00:00:00 2001 From: Ben Welsh <b@palewi.re> Date: Thu, 16 May 2024 13:22:16 -0400 Subject: [PATCH] Fix None check in update_chart to work with DataFrames What we have now will fail if you submit a DataFrame, saying: ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). --- datawrapper/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datawrapper/__main__.py b/datawrapper/__main__.py index a209076..e969d36 100644 --- a/datawrapper/__main__.py +++ b/datawrapper/__main__.py @@ -809,7 +809,7 @@ def update_chart( obj = self.get_chart(chart_id) # Add data, if provided - if data: + if data is not None: self.add_data(chart_id=obj["id"], data=data) # Return the result