You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working with ContractItems API I've stumbled upon a bug - while columns attribute in rowset always contains name "rawQuantity", row doesn't.
Example XML:
In current implementation, attributes taken from row are not parsed, it is assumed that columns count in rowset is equal to attributes count in row (or less, but a fix for that is already implemented).
In this situation, columns in row are "shifted" and included column is not even created. Instead, rawQuality is filled with singleton value, and singleton is filled with included value.
I've created a quick hack to remedy this situation (and my Python skill is quite low, so it can be very inefficient), but just by pre-filling a list with zero integer values and then re-filling it by index of column name. I don't like this kind of solution and ask for a more proper variant instead (if any).
Quick (and dirty) fix below:
# <hack>
# - check for missing attributes while columns do exist!
# very ugly hack and dunno what to do with zero values created
#
if (len(attributes)/2 < len(self.container._cols)):
hacklist=[0]*len(self.container._cols) #predef length!
for i in xrange(0, len(attributes), 2):
hacklist[self.container._cols.index(attributes[i])]=_autocast(attributes[i], attributes[i+1])
self.container.append(hacklist)
else:
# </hack>
self.container.append([_autocast(attributes[i], attributes[i+1]) for i in xrange(0, len(attributes), 2)])
P.S. I'm not a native English speaker, so some wordings may be incorrect. Feel free to ask if something is not quite understandable.
The text was updated successfully, but these errors were encountered:
While working with ContractItems API I've stumbled upon a bug - while columns attribute in rowset always contains name "rawQuantity", row doesn't.
Example XML:
In current implementation, attributes taken from row are not parsed, it is assumed that columns count in rowset is equal to attributes count in row (or less, but a fix for that is already implemented).
In this situation, columns in row are "shifted" and included column is not even created. Instead, rawQuality is filled with singleton value, and singleton is filled with included value.
I've created a quick hack to remedy this situation (and my Python skill is quite low, so it can be very inefficient), but just by pre-filling a list with zero integer values and then re-filling it by index of column name. I don't like this kind of solution and ask for a more proper variant instead (if any).
Quick (and dirty) fix below:
P.S. I'm not a native English speaker, so some wordings may be incorrect. Feel free to ask if something is not quite understandable.
The text was updated successfully, but these errors were encountered: