Open LalonSander opened 10 months ago
I suspect this is fixed upstream and may be resolved when we do our next release to PyPI. You can see update_chart at the HEAD of the trunk here. I don't see a publish_chart call anymore. https://github.com/chekos/Datawrapper/blob/main/datawrapper/__main__.py#L722-L816
🐛 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