Skip to content

Commit

Permalink
Add documentation and test on non-strict modes
Browse files Browse the repository at this point in the history
  • Loading branch information
thbar committed Jan 21, 2025
1 parent 661fe67 commit a03c7b3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/transport/lib/irve/data_frame.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,24 @@ defmodule Transport.IRVE.DataFrame do
There is no attempt to make this generic at this point, it is focusing solely
on the static IRVE use.
In strict mode (the default), the types are remapped as follow:
iex> Transport.IRVE.DataFrame.remap_schema_type(:geopoint)
:string
iex> Transport.IRVE.DataFrame.remap_schema_type(:number)
{:f, 32}
iex> Transport.IRVE.DataFrame.remap_schema_type(:boolean)
:boolean
iex> Transport.IRVE.DataFrame.remap_schema_type(:literally_anything)
:literally_anything
In non-strict mode (used by the current prototype), we read some types as `:string`
in order to apply clean-up before casting to the actual target type manually:
iex> Transport.IRVE.DataFrame.remap_schema_type(:boolean, _strict = false)
:string
iex> Transport.IRVE.DataFrame.remap_schema_type(:literally_anything, _strict = false)
:literally_anything
"""
def remap_schema_type(input_type, strict \\ true)

Expand Down

0 comments on commit a03c7b3

Please sign in to comment.