Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Python tool sets precision and scale of FixedDecimal to default value

ThatDataEngineer
5 - Atom

I am building a Python Tool for which it is critical that the metadata goes in as it is and comes out as it is. To see whether this is correct, I checked the input for my tool and to my surprise two FixedDecimals where passed as 19,6 (or the default precision and scale) while they were actually 20,0 and 8,0.

 

After some debugging, I found out that there is a bug in the ayx package. In the DataStreamUtils module, there is a piece of code that converts the precision and scale to the default when a column only has precision and no scale (hence a tuple of one parameter instead of two) which does not seem logical, as the scale can also be zero. I think this is a problem, because now FixedDecimals precision and scale don't make any sense and there is the risk of getting datatype definitions that are possibly truncating. To solve this, I wrote a small line of code on 743 (inside supplementWithDefaultLengths), that patches this issue: 

if field_type == 'FixedDecimal' and isinstance(field_length, tuple) and len(field_length) == 1:
field_length = (field_length[0], 0)

 
I am new to Alteryx and I am wondering who is maintaining the Python Tool... I would like to report this issue directly to them. Of course this is also important for others to know. 

1 REPLY 1
Felipe_Ribeir0
16 - Nebula

Hi @ThatDataEngineer 

 

Could you share a sample workflow where this issue can be seem?

Labels