Skip to content

TSC filters not formatting special characters like ", +" properly #829

@seve-martinez

Description

@seve-martinez

Tableau Server Version: 2020.1.7 (20201.20.0721.1350)

    server.version = '3.7'
    server.add_http_options({'verify': False})
    urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

I know that this has been brought up and was fixed in #686 and so I've been trying to figure out how to properly handle the passing special characters to TSC. However, I am unable to get it to function properly.

I have a Tableau filter with company name where it may be formatted as "Company, Inc" or "A&B Consulting". I've tried literal transformations of the special characters using str.replace(',', '%2C') but it comes through literally to the filter.

So the page will return with None everywhere and name was applied as "Company%2C%20Inc".

I've tried both hard coding it and using
filter_df['Global Organization Name'] = urllib.parse.quote(filter_df['Global Organization Name']) but neither fix the issue. It is still passed literally.

Here is my code of filter application (I have a dictionary of filters and values)

   # If a filter is a string, replace the semi-colon. Else pass the integer value.
   for k, v in filters.items():
        if all(isinstance(n, str) for n in v):
            op_str = ";".join(v)
            op_str = op_str.replace(';', ',')
            options.vf(k, op_str)
        else:
            options.vf(k, v[0])

    # Populate the views.
    for view in view_list:
        print(f'Exporting {view.name}...\n')
        destination = join(tempdir, view.name + '.pdf')
        server.views.populate_pdf(view, options)

I have been looking through the request options code but am unable to figure out what's going on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions