Skip to content

Commit

Permalink
Tested that changing table name works through the tables.main_table_n…
Browse files Browse the repository at this point in the history
…ame property and saves correctly
  • Loading branch information
Bryant Howell committed Dec 7, 2019
1 parent 7d9abdf commit 720c555
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions examples/tableau_documents_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def live_db_connection_changes():
print(ds)
print(ds.connections)
ds.ds_name = 'New Datasource Name'
ds.set
if ds.is_stored_proc is False:
if ds.main_table_type == 'table':
ds.tables.main_table_name = '[some other table]'
for conn in ds.connections:
conn.connection_name = 'Changed Connection Name'
t_file.save_new_file('New TDS')
Expand All @@ -37,7 +39,7 @@ def live_db_connection_changes():
print(ds)
print(ds.connections)
print(ds.ds_name)
print(ds.published)
print(ds.is_published)
for conn in ds.connections:
print(conn.connection_name)
print(conn.connection_type)
Expand Down
1 change: 1 addition & 0 deletions tableau_documents/tablea_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, relation_xml_obj: ET.Element):
self.join_relations = []
self.ns_map = {"user": 'http://www.tableausoftware.com/xml/user', 't': 'http://tableau.com/api'}
ET.register_namespace('t', self.ns_map['t'])
self._read_existing_relations()

def _read_existing_relations(self):
# Test for single relation
Expand Down
1 change: 0 additions & 1 deletion tableau_documents/tableau_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def __init__(self, datasource_xml: Optional[ET.Element] = None, logger_obj: Opti
if self.xml.get('name') != 'Parameters':
self.relation_xml_obj = self.xml.find('.//relation', self.ns_map)
self._table_relations = TableRelations(relation_xml_obj=self.relation_xml_obj)
self._read_existing_relations()
else:
self.log('Found a Parameters datasource')

Expand Down

0 comments on commit 720c555

Please sign in to comment.