You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Delete tag with special characters like '#' does not work #675
I found that if the tag contains encodable characters such as '#' (which is quite commonly used for tagging!), the delete tag request neither succeeds nor throws an exception.
@tv-terminator there could be an issue there (I think we have or had a similar bug with encoding special characters). Can you give a fuller code snippet example of how you're trying to delete tags? Also what type of resource are the tags associated with?
Thanks @tv-terminator for the repro steps. I can confirm this is a bug and your pointer to resource_tagger.py is where we are not properly quoting the tag.
Deleting the #test tag does not work, delete method throws a 405 error because "#test" is dropped from the URL:
DEBUG:urllib3.connectionpool:https://10ax.online.tableau.com:443 "DELETE /api/3.9/sites/MY-SITE-IT/workbooks/MY-WORKBOOK-ID/tags/ HTTP/1.1" 405 377
DEBUG:tableau.endpoint:b'<?xml version=\'1.0\' encoding=\'UTF-8\'?><tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.9.xsd"><error code="405000"><summary>Method Not Allowed</summary><detail>The HTTP method \'DELETE\' is not supported for the given resource</detail></error></tsResponse>'
Trying to delete a tag foo#bar shows the similar issue, with everything from the pound sign being dropped in the URL resulting in a 404:
DEBUG:urllib3.connectionpool:https://10ax.online.tableau.com:443 "DELETE /api/3.9/sites/MY-SITE-IT/workbooks/MY-WORKBOOK-ID/tags/foo HTTP/1.1" 404 342
DEBUG:tableau.endpoint:b'<?xml version=\'1.0\' encoding=\'UTF-8\'?><tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.9.xsd"><error code="404007"><summary>Resource Not Found</summary><detail>Tag \'foo\' could not be found.</detail></error></tsResponse>'
There are a few other open bugs around attributes with special characters, so hopefully we can resolve some of these together.
Activity
bcantoni commentedon Aug 29, 2020
@tv-terminator there could be an issue there (I think we have or had a similar bug with encoding special characters). Can you give a fuller code snippet example of how you're trying to delete tags? Also what type of resource are the tags associated with?
tv-terminator commentedon Aug 29, 2020
I have tried both workbooks & datasources; ended up with same result. Heres a full log with code:
`# w = workbook_item, t = tableau connection/hook
Works fine with a plain text tag:
`
[-]Delete tag does not work[/-][+]Delete tag with special characters like '#' does not work[/+]bcantoni commentedon Sep 1, 2020
Thanks @tv-terminator for the repro steps. I can confirm this is a bug and your pointer to
resource_tagger.pyis where we are not properly quoting the tag.Adding new #test tag works, put method:
Deleting the #test tag does not work, delete method throws a 405 error because "#test" is dropped from the URL:
Trying to delete a tag foo#bar shows the similar issue, with everything from the pound sign being dropped in the URL resulting in a 404:
There are a few other open bugs around attributes with special characters, so hopefully we can resolve some of these together.
tv-terminator commentedon Sep 1, 2020
Awesome! Thanks @bcantoni !
bcantoni commentedon Sep 2, 2020
Similar bugs related to encoding include #578, #516 and #418
fix: encode special characters in tag delete URL path
fix: encode special characters in tag delete URL path
fix: encode special characters in tag delete URL path
fix: quote tag labels containing spaces or commas (tableau#1782)