Uploading an attachment to a Wiki Article using the Python API
Hi,
I want to attach a .pptx file to a Wiki article using the Python API. To do this, I added the file to a managed folder and then tried the following (example found in the Documentation, Wikis — Dataiku DSS 11 documentation
article = wiki.get_article('article_name')
with open(file) as f:
article.upload_attachment(f, "ppt.pptx")
However, it seems like I am getting an AttributeError:
AttributeError: 'DSSWikiArticle' object has no attribute 'upload_attachment'
I am aware I can simply add the attachment to a wiki page, but I really would like to use the Python API here. What am I doing wrong?
Best Answer
-
We found the error: there seems to be a typo in the name of the method. The method that does exist is called: 'upload_attachement'.
Answers
-
tgb417 Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Frontrunner 2022 Finalist, Frontrunner 2022 Winner, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant, Neuron 2023 Posts: 1,598 Neuron
Welcome to the Dataiku Community. So glad you are here.
It looks like you have gone deep on this issue. Have you opened a support ticket on this topic. It would be good to get this reviewed by the support team and on a backlog with the Dataiku Development team so this can be fixed for all.
I’m not sure that posting here in the community will have the same effect…