Support decimal encoding of NaN and Infinities values#11
Support decimal encoding of NaN and Infinities values#11
Conversation
| return "NaN" | ||
| if value.is_infinite(): | ||
| if value.is_signed(): | ||
| return "-Infinity" | ||
| return "Infinity" |
There was a problem hiding this comment.
These are valid values for Trino NUMBER but not for DECIMAL.
If we return NaN for decimal, this should fail somewhere later. I think for DECIMALs it's better to keep failing here
There was a problem hiding this comment.
Since decimal is shared between decimal and number I think it's better to fail in Trino once nan or infinity is returned for Decimal
There was a problem hiding this comment.
Let's have a test for that:
|
I looked more into this. I see that Python's However, TrinoType enum is what it is -- enum of all trino types. If we do not want have more entries in TrinoType enum, then I think we should rename the existing one (DECIMAL → NUMBER). |
|
I can add a separate NUMBER type but it's handling will be similar to the decimal |
|
SGTM |
|
@findepi which version? ;) |
|
this one: |
No description provided.