8000 Update test TDS to have a field with no local-type and apply a defaul… · raincity206/document-api-python@d342cbe · GitHub
[go: up one dir, main page]

65F6 Skip to content

Commit d342cbe

Browse files
authored
Update test TDS to have a field with no local-type and apply a default of None (tableau#147)
1 parent c7a2926 commit d342cbe

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tableaudocumentapi/field.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def _initialize_from_column_xml(self, xmldata):
6565

6666
def _initialize_from_metadata_xml(self, xmldata):
6767
for metadata_name, field_name in _METADATA_TO_FIELD_MAP:
68-
self._apply_attribute(xmldata, field_name, lambda x: xmldata.find('.//{}'.format(metadata_name)).text,
68+
self._apply_attribute(xmldata, field_name,
69+
lambda x: getattr(xmldata.find('.//{}'.format(metadata_name)), 'text', None),
6970
read_name=metadata_name)
7071
self.apply_metadata(xmldata)
7172

test/assets/datasource_test.tds

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@
7171
<attribute datatype='string' name='DebugWireType'>&quot;SQL_C_SLONG&quot;</attribute>
7272
</attributes>
7373
</metadata-record>
74+
<metadata-record class='column'>
75+
<remote-name>z</remote-name>
76+
<remote-type>1</remote-type>
77+
<local-name>[z]</local-name>
78+
<parent-name>[z]</parent-name>
79+
<remote-alias>z</remote-alias>
80+
81+
<contains-null>true</contains-null>
82+
<attributes>
83+
<attribute datatype='string' name='DebugRemoteType'>&quot;SQL_INTEGER&quot;</attribute>
84+
<attribute datatype='string' name='DebugWireType'>&quot;SQL_C_SLONG&quot;</attribute>
85+
</attributes>
86+
</metadata-record>
7487
</metadata-records>
7588
</connection>
7689
<aliases enabled='yes' />

0 commit comments

Comments
 (0)
0