- 
        Couldn't load subscription status. 
- Fork 445
fix: handle parameters for view filters #1633
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
base: development
Are you sure you want to change the base?
Conversation
5f87ae5    to
    823cc97      
    Compare
  
    823cc97    to
    769d6a2      
    Compare
  
    769d6a2    to
    84a0863      
    Compare
  
    Closes tableau#1632 Parameters need to be prefixed with "vf_Parameters." in order to be properly registered as setting a parameter value. This PR adds that prefix where it was missing, but leaves parameter names that already included the prefix unmodified.
84a0863    to
    848c44f      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds automatic prefixing of parameter names with vf_Parameters. to ensure consistent formatting when using the parameter() method. The changes handle three scenarios: plain parameter names get the full prefix added, names starting with "Parameters." get "vf_" prepended, and names already prefixed with "vf_Parameters." are left unchanged.
- Automatic prefixing logic for parameter names in the parameter()method
- Support for flexible parameter name input formats
- Updated test cases to verify the new prefixing behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description | 
|---|---|
| tableauserverclient/server/request_options.py | Added prefix normalization logic to handle different parameter name formats | 
| test/test_request_option.py | Added new test cases for different parameter name prefixes and updated assertions to expect normalized parameter names | 
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| To restate on the PR: copilot recommends changing  import os
from dotenv import load_dotenv
import tableauserverclient as TSC
load_dotenv()
server = TSC.Server(os.environ["TABLEAU_SERVER"], use_server_version=True)
auth = TSC.PersonalAccessTokenAuth(os.environ["TOKEN_NAME"], os.environ["TOKEN_SECRET"], site_id=os.environ["TABLEAU_SITE"])
with server.auth.sign_in(auth):
    view = server.views.filter(name="test", workbook_name="Superstore", project_name="Samples")[0]
    opts = TSC.CSVRequestOptions()
    opts.parameter("Check", "sent")
    server.views.populate_csv(view, opts)
    for line in view.csv:
        print(line.decode("utf-8").strip()) | 
Closes #1632
Parameters need to be prefixed with "vf_Parameters." in order to be properly registered as setting a parameter value. This PR adds that prefix where it was missing, but leaves parameter names that already included the prefix unmodified.