Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug converting array type #674

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

changhiskhan
Copy link
Contributor

No description provided.

@@ -289,7 +289,9 @@ def _convert_col(self, col: pd.Series, field_type) -> pd.Series:
return col.apply(partial(_convert_udt_value, udt=udt))
elif field_type["type"] == "struct":
return col.apply(lambda d: self._convert(d, field_type))
elif field_type["type"] == "array":
elif field_type["type"] == "array" and isinstance(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there possible other case like type == array and not isinstance(elementType, dict)?

@@ -289,7 +289,9 @@ def _convert_col(self, col: pd.Series, field_type) -> pd.Series:
return col.apply(partial(_convert_udt_value, udt=udt))
elif field_type["type"] == "struct":
return col.apply(lambda d: self._convert(d, field_type))
elif field_type["type"] == "array":
elif field_type["type"] == "array" and isinstance(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there possible other case like type == array and not isinstance(elementType, dict)?

Copy link
Contributor Author

@changhiskhan changhiskhan Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the elementType is not a dict then it's a simple native type which requires no conversion so it should go to the "else"

Copy link
Collaborator

@eddyxu eddyxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. thanks for explanation

@changhiskhan changhiskhan merged commit a14ec2e into eto-ai:main Jun 8, 2022
@changhiskhan changhiskhan deleted the changhiskhan/bug-fix branch June 9, 2022 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants