10000 removed duplicate extract code · kgtdbx/document-api-python@bf53711 · GitHub
[go: up one dir, main page]

Skip to content

Commit bf53711

Browse files
author
Richard Kooijman
committed
removed duplicate extract code
1 parent 5bec00a commit bf53711

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

samples/connection-query/show_sql.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from tableaudocumentapi import Datasource
22

33
sourceTDS = Datasource.from_file('Sales.tds')
4+
print(sourceTDS.has_extract())
45

56
print(sourceTDS.get_query())
67

tableaudocumentapi/datasource.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def __init__(self, dsxml, filename=None):
157157
self._connection_parser = ConnectionParser(self._datasourceXML, version=self._version)
158158
self._connections = self._connection_parser.get_connections()
159159
self._fields = None
160-
self._extract = self._datasourceXML.findall("./extract")
161160
self._parameter_parser = ParameterParser(self._datasourceXML, version=self._version)
162161
self._parameters = self._parameter_parser.get_parameters()
163162
self._columns = None
@@ -295,7 +294,7 @@ def _get_db_column_objects(self):
295294
for xml in self._datasourceTree.findall('./connection/cols/map')])
296295

297296
def has_extract(self):
298-
return len(self._extract) > 0 and self._extract[0].attrib['enabled'] == 'true'
297+
return len(self._extracts) > 0 and self._extracts[0].enabled == 'true'
299298

300299
def process_columns(self):
301300
sub_elems = self._datasourceTree.findall('*')

tableaudocumentapi/field.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
'alias', # Name of the field as displayed in Tableau if the default name isn't wanted
1212
'calculation', # If this field is a calculated field, this will be the formula
1313
'description', # If this field has a description, this will be the description (including formatting tags)
14+
'family',
15+
'parent'
1416
]
1517

1618
_METADATA_ATTRIBUTES = [
@@ -20,7 +22,8 @@
2022
_METADATA_TO_FIELD_MAP = [
2123
('local-name', 'id'),
2224
('local-type', 'datatype'),
23-
('remote-alias', 'alias')
25+
('remote-alias', 'alias'),
26+
('parent-name', 'parent')
2427
]
2528

2629

0 commit comments

Comments
 (0)
0