Skip to content
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
3 changes: 2 additions & 1 deletion tableaudocumentapi/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def _initialize_from_column_xml(self, xmldata):

def _initialize_from_metadata_xml(self, xmldata):
for metadata_name, field_name in _METADATA_TO_FIELD_MAP:
self._apply_attribute(xmldata, field_name, lambda x: xmldata.find('.//{}'.format(metadata_name)).text,
self._apply_attribute(xmldata, field_name,
lambda x: getattr(xmldata.find('.//{}'.format(metadata_name)), 'text', None),
read_name=metadata_name)
self.apply_metadata(xmldata)

Expand Down
13 changes: 13 additions & 0 deletions test/assets/datasource_test.tds
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@
<attribute datatype='string' name='DebugWireType'>&quot;SQL_C_SLONG&quot;</attribute>
</attributes>
</metadata-record>
<metadata-record class='column'>
<remote-name>z</remote-name>
<remote-type>1</remote-type>
<local-name>[z]</local-name>
<parent-name>[z]</parent-name>
<remote-alias>z</remote-alias>

<contains-null>true</contains-null>
<attributes>
<attribute datatype='string' name='DebugRemoteType'>&quot;SQL_INTEGER&quot;</attribute>
<attribute datatype='string' name='DebugWireType'>&quot;SQL_C_SLONG&quot;</attribute>
</attributes>
</metadata-record>
</metadata-records>
</connection>
<aliases enabled='yes' />
Expand Down