Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 1 addition & 45 deletions 46 tableaudocumentapi/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ def __init__(self, connxml):
self._server = connxml.get('server')
self._username = connxml.get('username')
self._authentication = connxml.get('authentication')
self._schema = connxml.get('schema')
self._service = connxml.get('service')
self._class = connxml.get('class')
self._port = connxml.get('port', None)
self._query_band = connxml.get('query-band-spec', None)
Expand All @@ -28,7 +26,7 @@ def __repr__(self):

@classmethod
def from_attributes(cls, server, dbname, username, dbclass, port=None, query_band=None,
initial_sql=None, authentication='', schema='', service=''):
initial_sql=None, authentication=''):
"""Creates a new connection that can be added into a Data Source.
defaults to `''` which will be treated as 'prompt' by Tableau."""

Expand All @@ -37,8 +35,6 @@ def from_attributes(cls, server, dbname, username, dbclass, port=None, query_ban
xml.server = server
xml.dbname = dbname
xml.username = username
xml.schema = schema
xml.service = service
xml.dbclass = dbclass
xml.port = port
xml.query_band = query_band
Expand Down Expand Up @@ -210,43 +206,3 @@ def initial_sql(self, value):
pass
else:
self._connectionXML.set('one-time-sql', value)

@property
def schema(self):
"""Database schema for the connection. Not the table name."""
return self._schema

@schema.setter
def schema(self, value):
"""
Set the connection's schema property.

Args:
value: New name of the database schema. String.

Returns:
Nothing.

"""
self._schema = value
self._connectionXML.set('schema', value)

@property
def service(self):
"""Database service for the connection. Not the table name."""
return self._service

@service.setter
def service(self, value):
"""
Set the connection's service property.

Args:
value: New name of the database service. String.

Returns:
Nothing.

"""
self._service = value
self._connectionXML.set('service', value)
7 changes: 0 additions & 7 deletions 7 test/bvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ def test_can_create_connection_from_scratch(self):
self.assertEqual(conn.dbclass, 'mysql')
self.assertEqual(conn.authentication, 'd')

def test_can_create_oracle_connection_from_scratch(self):
conn = Connection.from_attributes(
server='a', dbname='b', username='c', dbclass='oracle', schema='d', service='e')
self.assertEqual(conn.server, 'a')
self.assertEqual(conn.schema, 'd')
self.assertEqual(conn.service, 'e')

def test_can_create_datasource_from_connections(self):
conn1 = Connection.from_attributes(
server='a', dbname='b', username='c', dbclass='mysql', authentication='d')
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.