Skip to content

Conversation

@jorwoods
Copy link
Contributor

@jorwoods jorwoods commented Jul 9, 2025

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.

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.
@jacalata jacalata requested a review from Copilot October 29, 2025 04:58
Copy link

Copilot AI left a 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.

@jorwoods
Copy link
Contributor Author

To restate on the PR: copilot recommends changing "vf_Parameters" to "vf_parameters". But the Tableau Server query parameter is case sensitive, so it has to be "vf_Parameters". Below is a sample script I used to test this.

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())

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View Filters on parameters

2 participants