GithubHelp home page GithubHelp logo

Comments (6)

t8y8 avatar t8y8 commented on June 26, 2024

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.

mpope-tableau avatar mpope-tableau commented on June 26, 2024

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.

t8y8 avatar t8y8 commented on June 26, 2024

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.

mpope-tableau avatar mpope-tableau commented on June 26, 2024

Got it.

from document-api-python.

t8y8 avatar t8y8 commented on June 26, 2024

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.

benlower avatar benlower commented on June 26, 2024

closing this. addressed in PR @ #10

from document-api-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.