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

[Ray dataset] detect dataframe dtype as object #25811

Merged
merged 6 commits into from
Jun 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
not break master
  • Loading branch information
JiahaoYao authored Jun 15, 2022
commit c8316a3aa80447a08e7d6be252382942501d8011
3 changes: 2 additions & 1 deletion python/ray/air/_internal/tensorflow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import pandas as pd
import tensorflow as tf
from pandas.api.types import is_object_dtype


def convert_pandas_to_tf_tensor(
Expand Down Expand Up @@ -51,7 +52,7 @@ def convert_pandas_to_tf_tensor(
# if the columns are `ray.data.extensions.tensor_extension.TensorArray`,
# the dtype will be `object`. In this case, we need to set the dtype to
# none, and use the automatic type casting of `tf.convert_to_tensor`.
if isinstance(dtype, object):
if is_object_dtype(dtype):
dtype = None

except TypeError:
Expand Down