Skip to content

Commit

Permalink
This will be 5.1 because of new objects and logger improvements (and …
Browse files Browse the repository at this point in the history
…who knows what else)
  • Loading branch information
Bryant Howell committed Dec 11, 2019
1 parent 040affd commit 34b35cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name='tableau_tools',
python_requires='>=3.6',
version='5.0.7',
version='5.1.0',
packages=['tableau_tools', 'tableau_tools.tableau_rest_api', 'tableau_tools.tableau_documents',
'tableau_tools.examples', 'tableau_tools.tableau_rest_api.methods'],
url='https://github.com/bryantbhowell/tableau_tools',
Expand Down
12 changes: 7 additions & 5 deletions tableau_documents/table_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import random
from xml.sax.saxutils import quoteattr, unescape
import copy
import datetime

from tableau_tools.tableau_exceptions import *
from ..tableau_exceptions import *
from ..tableau_rest_xml import TableauRestXml

# This represents the classic Tableau data connection window relations
# Allows for changes in JOINs, Stored Proc values, and Custom SQL
Expand All @@ -17,8 +19,8 @@ def __init__(self, relation_xml_obj: ET.Element):
self.main_table: ET.Element
self.table_relations: List[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.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):
Expand All @@ -29,7 +31,7 @@ def _read_existing_relations(self):
self.table_relations = [self.relation_xml_obj, ]

else:
table_relations = self.relation_xml_obj.findall('.//relation', self.ns_map)
table_relations = self.relation_xml_obj.findall('.//relation', TableauRestXml.ns_map)
final_table_relations = []
# ElementTree doesn't implement the != operator, so have to find all then iterate through to exclude
# the JOINs to only get the tables, stored-procs and Custom SQLs
Expand Down Expand Up @@ -118,7 +120,7 @@ def set_stored_proc_parameter_value_by_name(self, parameter_name: str, parameter
if self._stored_proc_parameters_xml is None:
self._stored_proc_parameters_xml = ET.Element('actual-parameters')
# Find parameter with that name (if exists)
param = self._stored_proc_parameters_xml.find('.//column[@name="{}"]'.format(parameter_name), self.ns_map)
param = self._stored_proc_parameters_xml.find('.//column[@name="{}"]'.format(parameter_name), TableauRestXml.ns_map)

if param is None:
# create_stored... already converts to correct quoting
Expand Down

0 comments on commit 34b35cc

Please sign in to comment.