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
TSC filters not formatting special characters like ", +" properly #829
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.
changed the title [-]get_query_params() not formatting special characters like ", +" properly[/-][+]TSC filters not formatting special characters like ", +" properly[/+]on Apr 2, 2021
Activity
[-]get_query_params() not formatting special characters like ", +" properly[/-][+]TSC filters not formatting special characters like ", +" properly[/+]seve-martinez commentedon Apr 7, 2021
Tableau requires that you escape those values with a backslash.
Company\, Incwill pass them correctly.