8000 Clarify that adding tags requires a list · Issue #52 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Clarify that adding tags requires a list #52

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

Closed
benlower opened this issue Oct 5, 2016 · 4 comments
Closed

Clarify that adding tags requires a list #52

benlower opened this issue Oct 5, 2016 · 4 comments
Labels

Comments

@benlower
Copy link
Contributor
benlower commented Oct 5, 2016

When calling tags.update("foobar") the result is the workbook being tagged with five tags: 'f', 'o', 'b', 'a', 'r'. To get the expected behavior you have to use tags.update(["foobar"]) because it expects a list. Clarify this.

@benlower benlower added the bug label Oct 5, 2016
@t8y8
Copy link
Collaborator
t8y8 commented Oct 5, 2016

I researched a few options:

  1. Check the tag_set, if it's a string, convert it to a list of one silently to the user doesn't have to think about it
  2. Check the tag_set, if it's not an iterable (except for string), throw an exception
  3. Do nothing, doc it more clearly.

It looks like the current implementation relies on sets so that it can determine if a workbook already has tags or not, and can compute the difference

@LGraber
Copy link
Contributor
LGraber commented Oct 6, 2016

For what he did, do nothing and doc since he called "update" on the set. If we want to, we can handle the case where the user assigns a value to "tags" which is a string or a list and convert it to a set instead of getting upset with them

@talvalin
Copy link
Contributor

I've been having a crack at this, and I'm a bit stuck.

Whilst it's simple enough to add a setter to workbook_item that checks for a string and then calls workbook.tags.add, there's nothing to stop someone from calling tags.update directly (ie: workbook.tags = 'foobar'), which then leads us back to the original reported issue.

Am I overthinking this? Is there a straightforward way of resolving the issue?

jacalata added a commit to jacalata/server-client-python that referenced this issue Apr 24, 2019
irwando pushed a commit that referenced this issue Jul 25, 2019
#52 docs - clarify tags must be a list
@irwando
Copy link
Contributor
irwando commented Jul 25, 2019

Docs are updated.

@irwando irwando closed this as completed Jul 25, 2019
bryceglarsen pushed a commit to bryceglarsen/server-client-python that referenced this issue Dec 28, 2023
)

* Fixes tableau#50 - materialize the properties for completion

This also fixes a bug where captions and aliases weren't being populated
into the multidict correctly due to insufficient testing on my part
originally

* fixing example to be correct

* really fix it this time

* Add docstrings for is_* properties

* Cleaner version of get for mld

* Move to is not instead of standard equality and fixed py3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
0