Skip to content

Commit b3eb4a5

Browse files
authored
fix: adapt benchmark tests to Glue for Ray GA breaking changes (#2316)
* fix: adapt Glue for Ray jobs creation to GA changes
1 parent fa84129 commit b3eb4a5

File tree

5 files changed

+905
-731
lines changed

5 files changed

+905
-731
lines changed

awswrangler/data_quality/_utils.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,16 @@ def _get_data_quality_results(
175175
)["Results"]
176176
rule_results: List[Dict[str, Any]] = []
177177
for result in results:
178-
rules = result["RuleResults"]
179-
for rule in rules:
180-
rule["ResultId"] = result["ResultId"] # type: ignore[typeddict-unknown-key]
181-
rule_results.extend(cast(List[Dict[str, Any]], rules))
178+
rule_results.extend(
179+
cast(
180+
List[Dict[str, Any]],
181+
[
182+
dict(
183+
((k, d[k]) for k in ("Name", "Description", "Result") if k in d), # type: ignore[literal-required]
184+
**{"ResultId": result["ResultId"]},
185+
)
186+
for d in result["RuleResults"]
187+
],
188+
)
189+
)
182190
return pd.json_normalize(rule_results)

awswrangler/distributed/ray/datasources/pandas_file_based_datasource.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self) -> None:
6464
def _read_file(self, f: pyarrow.NativeFile, path: str, **reader_args: Any) -> pd.DataFrame:
6565
raise NotImplementedError()
6666

67-
def do_write( # pylint: disable=arguments-differ
67+
def do_write( # type: ignore[override] # pylint: disable=arguments-differ
6868
self,
6969
blocks: List[ObjectRef[pd.DataFrame]],
7070
metadata: List[BlockMetadata],
@@ -141,7 +141,7 @@ def write_block(write_path: str, block: pd.DataFrame) -> str:
141141

142142
return write_tasks
143143

144-
def write( # type: ignore[override]
144+
def write(
145145
self,
146146
blocks: Iterable[Union[Block[pd.DataFrame], ObjectRef[pd.DataFrame]]],
147147
ctx: TaskContext,
@@ -198,7 +198,7 @@ def write_block(write_path: str, block: pd.DataFrame) -> str:
198198
path,
199199
filesystem=filesystem,
200200
dataset_uuid=dataset_uuid,
201-
block=block,
201+
block=block, # type: ignore[arg-type]
202202
block_index=ctx.task_idx,
203203
file_format=file_suffix,
204204
)

0 commit comments

Comments
 (0)