Skip to content

Commit 6600bc3

Browse files
fix DynamoDB error
1 parent 153fe89 commit 6600bc3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/static-checking.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
- name: Documentation check
4242
run: doc8 --max-line-length 120 docs/source
4343
- name: Check poetry.lock consistency with pyproject.toml
44-
run: poetry lock --check
44+
run: poetry check --lock

awswrangler/distributed/ray/modin/_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,18 @@ def _split_modin_frame(df: modin_pd.DataFrame, splits: int) -> list[ObjectRef[An
6262
return object_refs
6363

6464

65-
def _arrow_refs_to_df(arrow_refs: list[Callable[..., Any]], kwargs: dict[str, Any] | None) -> modin_pd.DataFrame:
65+
def _arrow_refs_to_df(arrow_refs: list[Callable[..., Any] | pa.Table], kwargs: dict[str, Any] | None) -> modin_pd.DataFrame:
6666
@ray_remote()
6767
def _is_not_empty(table: pa.Table) -> Any:
6868
return table.num_rows > 0 or table.num_columns > 0
6969

70+
if isinstance(arrow_refs[0], pa.Table):
71+
refs: list[pa.Table] = [table for table in arrow_refs if table.num_rows > 0 or table.num_columns > 0]
72+
return _to_modin(
73+
dataset=ray.data.from_arrow(refs) if len(refs) > 0 else ray.data.from_arrow([pa.Table.from_arrays([])]),
74+
to_pandas_kwargs=kwargs,
75+
)
76+
7077
ref_rows: list[bool] = ray_get([_is_not_empty(arrow_ref) for arrow_ref in arrow_refs])
7178
refs: list[Callable[..., Any]] = [ref for ref_rows, ref in zip(ref_rows, arrow_refs) if ref_rows]
7279
return _to_modin(

0 commit comments

Comments
 (0)