Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ultmaster committed Jan 15, 2024
1 parent beb51b9 commit b78766b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions coml/prompt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ def check_type(dtype: str, value):

properties_list = []
for column in df.columns:
if not hasattr(df[column], "dtype"):
try:
dtype = df[column].dtype
except AttributeError:
# This can sometimes happen when the column is a dataframe by itself
properties_list.append(
{"column": column, "properties": {"dtype": "unknown"}}
)
continue

dtype = df[column].dtype
properties = {}
if dtype in [int, float, complex]:
properties["dtype"] = "number"
Expand Down

0 comments on commit b78766b

Please sign in to comment.