GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — workbook filter fails with special characters. · Issue #1200 · tableau/server-client-python

workbook filter fails with special characters.  #1200

New issue
Copy link
New issue
Copy link
Open
Open
workbook filter fails with special characters. #1200
Copy link
Labels
docshelp wantedA user needs help, may be a mistake, a bug or a feature requestA user needs help, may be a mistake, a bug or a feature requestin-progressIssues that are in-progress of being fixedIssues that are in-progress of being fixed

Description

@VDFaller
VDFaller
opened on Feb 28, 2023
Issue body actions

Describe the bug
If my workbook has special character in it, my filter fails. I'm currently working around this but hoping that it can be fixed.

Versions
Details of your environment, including:

  • Tableau online
  • Python version: 3.9.12
  • tableauserverclient==0.23.4

To Reproduce

    with server.auth.sign_in(tableau_auth):
        wbs = server.workbooks.all()
        wbs.filter(name="T(L-F,SZ&V-MY) - PC")
        next(iter(wbs_iter)) # this will fail

Results

ServerResponseError: 

	400065: Bad Request
		None

Activity

  1. jacalata commented on Mar 14, 2023

    @jacalata
    jacalata
    on Mar 14, 2023
    Contributor
    More actions

    Unfortunately you can't represent some characters in a search, but you can replace them with a wildcard.
    Specifically, I think it's "," and "&" that don't work. But this does:

    ` wb_name = "T(L-FSZV-MY) - PC"

        print("Searching for " + wb_name + "")
    
        for workbook in server.workbooks.filter(name=wb_name):
    
            print(workbook.name, workbook.id)
    

    `

    produces:
    Searching for T(L-F*SZ*V-MY) - PC
    T(L-F,SZ&V-MY) - PC b5d8b87f-3a3c-4787-83d4-6fd5cc2664db
    T(L-F^SZ|V-MY) - PC 44ea14d9-54e8-4b9f-9ec9-150fbea57b08

    https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_filtering_and_sorting.htm#filter-expression-notes

  2. jacalata
    added
    help wantedA user needs help, may be a mistake, a bug or a feature requestA user needs help, may be a mistake, a bug or a feature request
    fixed
    on Mar 16, 2023
  3. jacalata
    added
    docs
    on Apr 12, 2023
  4. jacalata commented on Apr 12, 2023

    @jacalata
    jacalata
    on Apr 12, 2023
    Contributor
    More actions

    Should make sure our docs mention this limitation and workaround.

  5. VDFaller commented on Apr 20, 2023

    @VDFaller
    VDFaller
    on Apr 20, 2023
    Author
    More actions

    So would it make sense to add a replace_illegal_chars argument, hopefuly something pithier, to filter? I could try it if I get a hint or something. There's not a lot of doc strings in this repo.

    Maybe here?

    something like

    def filter(self, *invalid, **kwargs):
        if invalid:
            raise RuntimeError(f"Only accepts keyword arguments.")
        # special arg to allow for filtering on fields that contain illegal characters
        replace_illegal_characters = kwargs.pop("replace_illegal_characters", False)
        
        for kwarg_key, value in kwargs.items():
            field_name, operator = self._parse_shorthand_filter(kwarg_key)
            if replace_illegal_characters:
                value = self._replace_illegal_characters(value)
            self.request_options.filter.add(Filter(field_name, operator, value))
        return self
    
    def _replace_illegal_characters(self, value):
        """helper function to replace illegal characters in a string value for filtering"""
        if isinstance(value, str):
            return value.replace(",", "*").replace('&', '*')
        return value
  6. mtwalkup commented on Nov 16, 2023

    @mtwalkup
    mtwalkup
    on Nov 16, 2023
    More actions

    Not sure if this applies here, but we've run into issues with commas in other queries. We got around them by replacing , with %5C%2C instead of just %2C. If I can figure out how to test a patch I may try it when I have some more time.

  7. mtwalkup commented on Nov 17, 2023

    @mtwalkup
    mtwalkup
    on Nov 17, 2023
    More actions

    Disregard my last comment, I tried to make it work and forced a \ (%5C) before the comma still got a 400 error.

    However; just wanted to also note I am getting this same problem with a job filter.

    Edit: comma instead of command

  8. jacalata commented on Sep 20, 2024

    @jacalata
    jacalata
    on Sep 20, 2024
    Contributor
    More actions

    We have a bunch of questions around filters, and will go through all of them to carefully document current behavior. that might turn into some work items if there are inconsistencies/gaps.

  9. jacalata
    removed
    fixed
    on Sep 20, 2024
  10. github-actions commented on Aug 6, 2026

    @github-actions
    github-actionsBot
    on Aug 6, 2026 – with GitHub Actions
    More actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.

  11. github-actions
    added
    stale
    on Aug 6, 2026
  12. jacalata
    added
    in-progressIssues that are in-progress of being fixedIssues that are in-progress of being fixed
    and removed
    stale
    on Aug 16, 2026
  13. jacalata
    added a commit that references this issue on Sep 10, 2026

    docs: clarify username formats, ProjectLeader-as-group, and filter sp…

    3113794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docshelp wantedA user needs help, may be a mistake, a bug or a feature requestA user needs help, may be a mistake, a bug or a feature requestin-progressIssues that are in-progress of being fixedIssues that are in-progress of being fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.