Comments (6)
I did a little more thinking about this.
The problem is that a datasource, post 10, can contain multiple connections, so the interface for Datasouce that returns a single item is no longer valid.
I think we could extend Datasource.connection to return a list if there's more than one connection, and behave the old way if there is only one, or always operate on lists for consistency, that's a good question for debate.
My idea is to create a new class that encapsulates the 10 and pre 10 differences. DatasourceParser or ConnectionParser I'm not sure yet.
Once my tests are checked in I can add a 10 workbook to the suite and start trying a few things.
from document-api-python.
The example we have for updating connection information in a workbook implies that there can be multiple ones:
sourceWB.datasources[0].connection.server = "MY-NEW-SERVER"
Or am I misunderstanding your point?
from document-api-python.
There can be multiple datasources, which we index to 0 -- but in 10, that datasource can have multiple connections, so it'd need to be sourceWB.datasources[0].connection[0].server = "MY-NEW-SERVER"
from document-api-python.
Got it.
from document-api-python.
This XPath query will get all connection nodes that we care about (ignoring the connection 'federated' class): ds.findall('.//named-connections/named-connection/*')
We could extend the connections property to check the DS version and, if V10, instead call that XPath and return a list of connections. Ideally that could just be a new class and we can call 'get_connections()' but that's a refactor that could happen later.
What I don't know is if you have to update the connection element AND the named-connection element.. or at least the caption. @benlower or @LGraber know anyone who might know?
from document-api-python.
closing this. addressed in PR @ #10
from document-api-python.
Related Issues (20)
- Unused/multiple namespaces will be lost when document is saved
- Identify the Color Palette used in the Dashboard HOT 1
- Identify color palette used in Tableau Dashboard
- Insert a Group of data - feature request HOT 1
- .twbx files not being recognised as such
- released version 0.8 not pushed to Pypi HOT 6
- Add ability to exclude hidden fields
- Fields' duplicates in datasource
- update path (i.e. site) within workbook XML
- throwing error when we edit and save the twbx file containing both live and extract connections.
- Additional Loggers added in the latest release while creating Workbook object HOT 3
- Bugfix for Schema Change: Support for Relations and Objects HOT 1
- Bug: v0.10 prints content with fields.values() HOT 5
- Packaging issues
- Hidden property doesn't work as expected.
- Missing attributes for metadata-records
- Cannot get field attributes
- Create and modify Tableau workbook and datasource files
- Alternative for Document Api HOT 2
- Change Tableau Published Data Source HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from document-api-python.