sapientml / core

A SapientML plugin of SapientMLGenerator
Apache License 2.0
10 stars 12 forks source link

Fix AttributeError in __is_bool Method for Non-String Data #44

Closed ihkao closed 10 months ago

ihkao commented 10 months ago

This PR addresses an issue in the __is_bool method within the EDA component. Previously, the method attempted to call .lower() and .strip() on all elements of the unique_vals array without checking their data types. This behavior caused an AttributeError when the array contained non-string data types, such as floats. The error is illustrated below:

sorted_unique_vals = sorted([_.lower().strip() for _ in unique_vals])
                                 ^^^^^^^
AttributeError: 'float' object has no attribute 'lower'

Modifications:

Impact: