Hi Dima,
Thanks for finding this bug would you mind filing a JIRA (
https://issues.apache.org/jira
<https://issues.apache.org/jira/secure/Dashboard.jspa>).
Note that this code works fine if you put quotes around the decimal value
(e.g. Decimal('123.234')), but as you state it crashes python because the
Decimal created without quotes requires more then 38 decimal places to
represent.
Thanks,
Micah
On Thu, Oct 24, 2019 at 7:53 AM Дима Фомин <[email protected]> wrote:
> Digging this I just found that this code breaks my Python Kernel :(
>
> import sqlalchemy as sq
> import pyarrow as pa
>
> aaa, bbb = sq.sql.sqltypes.decimal.Decimal(123.234),
> sq.sql.sqltypes.decimal.Decimal(123.234)
> ddd = [aaa, bbb]
> pa.array(ddd)
>
> So seems pyarrow.array is limited with types of array elements, doesnt'it?
>
> WBR,
> Dima Fomin
>
> 24.10.2019, 15:47, "Dima Fomin" <[email protected]>:
>
> Hello!
> First of all thank you very much for your efforts on Apache Arrow! This
> looks very useful and prominent tech to be able use it in self-BI area.
>
> I faced such issues - get Subj Error
>
> ArrowNotImplementedError: No cast implemented from decimal(2,2) to
> decimal(12,2)
>
> when trying to *pyarrow.Table.from_batches* array of values defined in
> schema as *pyarrow.decimal128(12,2)*.
>
> Which values are in fact column of
> *sqlAlchemy.sql.sqltypes.DECIMAL()="DECIMAL(precision=12,scale=2)"*
> values, which I map in schema like this *pyarrow.decimal128(12,2)*.
>
> What could be a reason of issue?
> Could it be that somehow declared decimal type of data is reduced to
> minimum value which met in data? :/
>
> With best regards,
> Dima Fomin
>
>