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

Update RayDP to be compatible with Ray 2.5.0 #354

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
18 changes: 13 additions & 5 deletions python/raydp/spark/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,22 @@ def get_locations(blocks):
]

def ray_dataset_to_spark_dataframe(spark: sql.SparkSession,
arrow_schema,
dataset_schema,
blocks: List[ObjectRef],
locations = None) -> DataFrame:
locations = get_locations(blocks)
if not isinstance(arrow_schema, pa.lib.Schema):
if hasattr(arrow_schema, "base_schema") and \
not isinstance(arrow_schema.base_schema, pa.lib.Schema):
raise RuntimeError(f"Schema is {type(arrow_schema)}, required pyarrow.lib.Schema. \n" \
arrow_schema = dataset_schema
if not isinstance(dataset_schema, pa.lib.Schema):
if hasattr(dataset_schema, "base_schema"):
if isinstance(dataset_schema.base_schema, pa.lib.Schema):
arrow_schema = dataset_schema.base_schema
else:
raise RuntimeError(f"Schema is {type(dataset_schema.base_schema)}, " \
f"required pyarrow.lib.Schema. \n" \
f"to_spark does not support converting non-arrow ray datasets.")
else:
raise RuntimeError(f"Schema is {type(dataset_schema)}, " \
f"required pyarrow.lib.Schema. \n" \
f"to_spark does not support converting non-arrow ray datasets.")
schema = StructType()
for field in arrow_schema:
Expand Down