Datawrapper icon indicating copy to clipboard operation
Datawrapper copied to clipboard

update_chart() returns view of the chart, which cannot be turned off

Open LalonSander opened this issue 6 months ago • 1 comments

🐛 Bug Report

When update_chart successfully executes it calls self.publish_chart at the end with default parameters, ie display = True. This means that calling update_chart returns a display of the chart which cannot be turned off. This causes a warning when using update_chart in scripts that are not interactive and fills up my log.

To fix, either call self.publish_chart with display set to False. Or add a display parameter to update_chart that is passed to the self.publish_chart call.

https://datawrapper.readthedocs.io/en/latest/_modules/datawrapper/main.html#Datawrapper.update_chart

🔬 How To Reproduce

Code sample

chart_updater.py

#load datawrapper library from datawrapper import Datawrapper

#define chart id chart_id = 'ABCD' #insert valid chart_id here

#update chart dw = Datawrapper() dw.update_chart(chart_id=chart_id, title='New Title')

Environment

  • OS: Linux/MacOS
  • Python version, get it with: 3.7, 3.9

LalonSander avatar Dec 12 '23 14:12 LalonSander