Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LalonSander opened this issue Dec 12, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@LalonSander
Copy link

🐛 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 LalonSander added the bug Something isn't working label Dec 12, 2023
@palewire
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants