Repository navigation
[DataFrame] Handling zero length partitions - #2210
Conversation
|
Test FAILed. |
b970a4c to
1da7e03
Compare
|
Test FAILed. |
There was a problem hiding this comment.
Formatting is a bit weird. Move = to previous line to be consistent with line 200?
There was a problem hiding this comment.
The concat from earlier constructs a new DataFrame with a new _IndexMetadata which gets overwritten here. Ideally, we could modify concat to pass this _indexMetadata to the DataFrame constructor, but I'm not sure if this is possible to do elegantly with the current code base.
No need to make a change to the PR, but would like to point this out.
There was a problem hiding this comment.
The issue here is that the reindex that is applied on columns changes the partition structure and the old _IndexMetadata created on concat is invalid. I agree that duplicate work is being done here, but I'm not sure there is a nice solution.
There was a problem hiding this comment.
I'm planning to rewrite the majority of this class sometime this week, both to make it more performant and more clean.
1da7e03 to
e30c4af
Compare
|
Test FAILed. |
|
Jenkins, retest this please |
|
Test FAILed. |
|
Jenkins, retest this please |
|
Test FAILed. |
|
Jenkins, retest this please |
|
Test FAILed. |
|
Jenkins, retest this please |
|
Jenkins, retest this please. |
|
Test PASSed. |
devin-petersohn
left a comment
There was a problem hiding this comment.
Left a few comment. Thanks for the fix!
There was a problem hiding this comment.
I'm planning to rewrite the majority of this class sometime this week, both to make it more performant and more clean.
| all_empty = ray.get(_map_partitions( | ||
| lambda df: df.empty, self._row_partitions)) | ||
| return False not in all_empty | ||
| return self._row_metadata._empty |
There was a problem hiding this comment.
A more efficient approach would be return len(self.columns) == 0 or len(self.rows) == 0. This would also simplify a lot of the code in _IndexMetadata.
| else: | ||
| lengths_oid = _build_col_widths.remote(dfs) | ||
| coord_df_oid = _build_coord_df.remote(lengths_oid, index) | ||
| self._empty = _check_empty.remote(dfs) |
There was a problem hiding this comment.
We are doing this twice, once for each of column_metadata and row_metadata.
| @ray.remote | ||
| def _check_empty(dfs): | ||
| """Check if all partitions are empty""" | ||
| return all(ray.get([_deploy_func.remote(_get_empty, d) for d in dfs])) |
There was a problem hiding this comment.
I don't think you need this (or _get_empty if you make some of the other changes, but a more efficient way to implement something like this is:
return next((False for d in dfs if not ray.get(_deploy_func.remote(_get_empty, d))), True)
e30c4af to
5ccca59
Compare
|
Test FAILed. |
|
Jenkins, retest this please. |
1 similar comment
|
Jenkins, retest this please. |
|
Test PASSed. |
* 'master' of https://github.com/ray-project/ray: (157 commits) Fix build failure while using make -j1. Issue 2257 (ray-project#2279) Cast locator with index type (ray-project#2274) fixing zero length partitions (ray-project#2237) Make actor handles work in Python mode. (ray-project#2283) [xray] Add error table and push error messages to driver through node manager. (ray-project#2256) addressing comments (ray-project#2210) Re-enable some actor tests. (ray-project#2276) Experimental: enable automatic GCS flushing with configurable policy. (ray-project#2266) [xray] Sets good object manager defaults. (ray-project#2255) [tune] Update Trainable doc to expose interface (ray-project#2272) [rllib] Add a simple REST policy server and client example (ray-project#2232) [asv] Pushing to s3 (ray-project#2246) [rllib] Remove need to pass around registry (ray-project#2250) Support multiple availability zones in AWS (fix ray-project#2177) (ray-project#2254) [rllib] Add squash_to_range model option (ray-project#2239) Mitigate randomly building failure: adding gen_local_scheduler_fbs to raylet lib. (ray-project#2271) [rllib] Refactor Multi-GPU for PPO (ray-project#1646) [rllib] Envs for vectorized execution, async execution, and policy serving (ray-project#2170) [Dataframe] Change pandas and ray.dataframe imports (ray-project#1942) [Java] Replace binary rewrite with Remote Lambda Cache (SerdeLambda) (ray-project#2245) ...
This filters out zero length partitions on getting
col_partitionsorrow_partitions.