Uploading an attachment to a Wiki Article using the Python API

Solved!
Jus
Level 2
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?

0 Kudos
1 Solution
Jus
Level 2
Author

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'.

View solution in original post

0 Kudos
2 Replies
Jus
Level 2
Author

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'.

0 Kudos
tgb417

@Jus 

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โ€ฆ 

--Tom
0 Kudos