tableau / connector-plugin-sdk

SDK for Developing Tableau Connector Plugins
https://tableau.github.io/connector-plugin-sdk/
MIT License
105 stars 107 forks source link

[BUG] TDVT action add_ds corrupts connection element of tds files #1218

Closed hab6 closed 4 months ago

hab6 commented 5 months ago

Describe the bug When executing tdvt action --add_ds, the attributes of the connection element in the tds files are getting corrupted. In our case, the connection attribute class='actian_odbc' is being removed from the connection element as the attribute tdvtconnection=dsn123 is added. The tdvtconnection value (shown here as dsn123) doesn't seem to matter.

Research To isolate the problem, I extracted the functions mangle_tds and updated_tds_as_str from setup_env.py into a simple test program parse2.py.txt. There were changes to this area of code in PR 1208.

Console Output of Test Program

C:\test> copy test.tds.orig test.tds

C:\test> python parse2.py
Modifying ./test.tds

C:\test> diff test.tds.orig test.tds
1c1
< <connection class='actian_odbc' dbname='testv1' one-time-sql='' port='21064' schema='abcschema' server='localhost' username='abctest' />
---
> <connection tdvtconnection='dsn123' dbname='testv1' one-time-sql='' port='21064' schema='abcschema' server='localhost' username='abctest' />

Desktop

Python & package versions

C:\test> python -V
Python 3.10.7

C:\test> pip list
Package    Version
---------- -------
defusedxml 0.7.1
pip        23.3.2
setuptools 63.2.0
tdvt       2.13.4

About you: Name: Michael Habiger Company: Actian Corporation

lukewrites commented 5 months ago

Thanks, I'll take a look.

Internal tracking: W-14959403

hab6 commented 5 months ago

@lukewrites I'm curious if you were able to reproduce the problem with the given test case.

lukewrites commented 4 months ago

Hi @hab6 sorry for the delay I was out of office, planning to push a change to master today for this

lukewrites commented 4 months ago

Hi @hab6 will have a PR out in a bit with our quarterly release that fixes this, but I put the code change from the release that should make it work on this branch: https://github.com/tableau/connector-plugin-sdk/tree/tds-regex

hab6 commented 4 months ago

We appreciate the updates @lukewrites