Skip to content

Commit

Permalink
Add new case for simple type mapping in unit tests
Browse files Browse the repository at this point in the history
Extended the "test_add_dtypes_types" function in unit tests by adding a new case for simple type mapping override with additional_mapper_dicts. This new test case will ensure the accuracy and efficiency of mapping "float64" to "float32[pyarrow]".

Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com>
  • Loading branch information
DanielAvdar committed Mar 7, 2024
1 parent a546036 commit cd1b514
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/unit/test_add_dtypes_mapper_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
expected_dtype="timestamp[ms,UTC][pyarrow]",
additional_mapper_dicts={"datetime64[ms]": "timestamp[ms,UTC][pyarrow]"},
)
@Parametrization.case(
name="test simple type mapping override with additional_mapper_dicts ms",
df_data=pd.DataFrame(
{"test_column": [0.0000000001, 2.0, 3.0, None]}, dtype="float64"
),
expected_dtype="float32[pyarrow]",
additional_mapper_dicts={"float64": "float32[pyarrow]"},
)
def test_add_dtypes_types(df_data, expected_dtype, additional_mapper_dicts):
sa = SchemArrow(custom_mapper=additional_mapper_dicts)
adf = sa(df_data)
Expand Down

0 comments on commit cd1b514

Please sign in to comment.