elixir-explorer / explorer

Series (one-dimensional) and dataframes (two-dimensional) for fast and elegant data exploration in Elixir
https://hexdocs.pm/explorer
MIT License
1.12k stars 123 forks source link

Stop inference of type if dtype is given and manually decode terms where needed #928

Closed philss closed 5 months ago

philss commented 5 months ago

This is a continuation of https://github.com/elixir-explorer/explorer/pull/923

We are now delegating to the backend the job of decoding the terms instead of casting if the dtype is different from the inferred dtype. In fact we stopped to infer the type if the dtype is given.

In a nutshell, this PR:

  1. removes the inference of type if :dtype is given.
  2. stop casting if given dtype and inferred dtype are different, because point 1.
  3. adds a manual decoding of terms for the functions that may accept special values (structs or integers).

The main goal is to improve performance, as discussed in #922.

philss commented 5 months ago

@billylanchantin Thank you! I don't think that test is obsolete because it is covering the inference algorithm, so I would keep that :D