server_address doesn't get updated on workbook publish
還沒有人認領這個 Issue。
評估
研究方向
Start at workbooks.publish and compare the connections= path with the deprecated connection_credentials= path. Inspect tableauserverclient/models/connection_credentials.py and server/request_factory.py around line 38, then reproduce publishing with differing dev.example.com and production.example.com addresses. Done means the embedded connection's server_address is updated during publish and the workbook connects successfully.
由索引模型根據 Issue 內容生成。
描述
I'm working on a script that would push one workbook to multiple Tableau sites. Each site has a different database to connect to, so the embedded connection needs to be updated appropriately.
I'm trying to accomplish this by updating the embedded datasource connection information in the packaged workbook. Feel free to let me know if there's a better way to do this as I'm new to Tableau in general.
Currently, I have this:
conn_creds = TSC.ConnectionCredentials(name=rds_user,
password=rds_pass)
# Create a connection and add the above credentials to it
connection = TSC.ConnectionItem()
connection.server_address = rds_host
connection.server_port = rds_port
connection.connection_credentials = conn_creds
# Publish the workbook to tableau
publish_item = server.workbooks.publish(new_workbook,
workbook_file,
publish_mode,
connections=[connection])
This seems to work if the workbook was exported with the server_address set to the same thing as my rds_host above. So if rds_host and the server address in the workbook are both dev.example.com, it will update the credentials and publish correctly.
However, if rds_host is production.example.com and the workbook has dev.example.com, Tableau returns a failed to establish a connection to your datasource error message even though the credentials are correct.
Before I tried the above solution, I was using the (now deprecated?) connection_credentials attribute like this:
conn_creds = TSC.ConnectionCredentials(name=rds_user,
password=rds_pass)
# Publish the workbook to tableau
publish_item = server.workbooks.publish(new_workbook,
workbook_file,
publish_mode,
connection_credentials=conn_creds)
This had the same effect of updating the username/password correctly, but would not update the server_address.
https://tableau.github.io/server-client-python/docs/api-ref#workbooks under workbooks.publish actually does not mention the connections= attribute at all, only connection_credentials. There was a warning message logged saying it was deprecated that lead me to use connections.
https://tableau.github.io/server-client-python/docs/api-ref#connections under ConnectionCredentials class mentions server_address and server_port attributes, but they don't seem to exist in https://github.com/tableau/server-client-python/blob/v0.7/tableauserverclient/models/connection_credentials.py and aren't used in https://github.com/tableau/server-client-python/blob/v0.7/tableauserverclient/server/request_factory.py#L38
Please let me know if I need to clarify anything or if more information is needed. I haven't looked at the code too much for this library yet, but when I get some time I planned on testing the same process with the rest api directly to verify that it isn't an issue with the server api itself.
- 主要語言
- Python
- 星號
- 716
- 分支
- 446
- 平均合併
- 8 天 8 小時
- 30 天內合併 PR
- 2
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
tableau/server-client-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
tableau/server-client-python#1865 ·
-
in-progress
難度 2/5 1-3 小時 新手友好度 78/100
tableau/server-client-python#1829 · 1 則留言 ·
-
enhancement gap needs investigation
難度 2/5 1-3 小時 新手友好度 68/100
tableau/server-client-python#1322 · 1 則留言 ·
-
[Type2] Allow Incremental Refresh type schedules to be added via `server.schedules.add_to_schedule` 未關閉help wanted Server-Side Enhancement ui-exists
難度 2/5 1-3 小時 新手友好度 68/100
tableau/server-client-python#1101 · 3 則留言 ·
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 68/100
tableau/server-client-python#783 · 5 則留言 ·
查看 tableau/server-client-python 的全部 Issue
相似的 Issue
-
bug priority:low
難度 2/5 1-3 小時 新手友好度 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
難度 2/5 1-3 小時 新手友好度 86/100
NousResearch/hermes-agent#122386 · 1 則留言 ·
-
ai-generated
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 78/100
vllm-project/production-stack#1105 ·
-
難度 2/5 1-3 小時 新手友好度 88/100