tableau / server-client-python

A Python library for the Tableau Server REST API
https://tableau.github.io/server-client-python/
MIT License
656 stars 422 forks source link

Urgent: Filter doesn't recognize multi-word option #763

Closed ElenaSemMD closed 2 years ago

ElenaSemMD commented 3 years ago

Hi!

That's urgent. Please take a look!

I have many automated tasks using TSC created back in 2019. After recent package update (downloaded new TSC and updated anaconda3/pkg) filtering by name containing a whitespace doesn't work.

For example, My Tableau site contains projects 'SignWorks' , 'Labor Statistics'.
Use these values for variable ind_prj in the filter option below.

req_option = TSC.RequestOptions()
req_option.filter.add(TSC.Filter(TSC.RequestOptions.Field.Name,
                                 TSC.RequestOptions.Operator.Equals, 
                                 ind_prj))

pub_projects,  pagination_item=server_pub.projects.get(req_option)

if pub_projects:
    project_name = pub_projects.pop().name
    print(project_name)
else:
    error = "No project named '{}' found".format(ind_prj)
    print(error)

Only project 'SignWorks' returned.

'Labor Statistics' returned only when compared explicitly like here:

all_projects,  pagination_item=server_pub.projects.get()
for project in all_projects:
   if project.name ==ind_prj:
      print(f'\tProject found:{project.name}')

Will greatly appreciate your help with this!

Thank you,

Elena

bcantoni commented 3 years ago

@ElenaSemMD could you confirm which version of Tableau Server you are using?

I've done some quick testing with 2019.4.14 and 2020.4.0 and it seems to work correctly, but it might be an issue just with specific older versions.

ElenaSemMD commented 3 years ago

Hi Brian

It's 2020.2.3. We'll upgrade to latest version 2020.3.x in end-January, 2021.

I can do a WebEx if needed to show the behavior.

Thank you for your help!

Elena

On Thu, Dec 17, 2020, 6:17 PM Brian Cantoni notifications@github.com wrote:

@ElenaSemMD https://github.com/ElenaSemMD could you confirm which version of Tableau Server you are using?

I've done some quick testing with 2020.4 and it works fine, but it might be an issue just with specific older versions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tableau/server-client-python/issues/763#issuecomment-747764870, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASFFOFJ7XPISQSFP75RQOV3SVKGPRANCNFSM4U753KYQ .

shinchris commented 3 years ago

This should be fixed with the upgrade to the latest 2020.3 version. There was a recent bug fix around filters, and TSC v0.14+ was also updated to match the fixed behavior. Verified on 2020.2.8.

For now, I would suggest using v0.13 for your scripts to work.

ElenaSemMD commented 3 years ago

Awesome, thanks!

Much appreciated, Brian!

On Fri, Dec 18, 2020, 11:23 AM Chris Shin notifications@github.com wrote:

This should be fixed with the upgrade to the latest 2020.3 version. There was a recent bug fix around filters, and TSC v0.14+ was also updated to match the fixed behavior. Verified on 2020.2.8.

For now, I would suggest using v0.13 for your scripts to work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tableau/server-client-python/issues/763#issuecomment-748186321, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASFFOFODIVDZV4LL5OCGSW3SVN6XNANCNFSM4U753KYQ .

Smoothbore45 commented 2 years ago

I am having the same issue in using the req_options when extracting a view. In below code: req_options.vf('Salesperson Location', '1100-Mitchell County')
I am certain that the field name 'Salesperson Location' is being handled. If I send that value, it overrides the filter I have in Tableau set to a different value. However the '1100-Mitchell County' is not being taken in as a value to filter on. I have tried + and %20 in the space. I have latest version of TSC in python and Tableau server is 2020.4.5 I am not certain if this is the same issue as above, or just very similar.

bcantoni commented 2 years ago

@Smoothbore45 could you please create a new issue with all the details of the problem you're seeing?