Skip to content

Commit

Permalink
[CI] Fix: flake8 rule B108: Found useless Tuple expression. Consider …
Browse files Browse the repository at this point in the history
…either assigning it to a variable or removing it. (ray-project#48118)

## Why are these changes needed?

While running the pre-commit hook of flake8, the following error occurs
if Python version is 3.12. It's because the version of flake8 is too
old.

![image](https://github.com/user-attachments/assets/7c103728-2e48-42f3-8b2f-b47ab93e560b)

version:
- python: 3.12.7
- flake8: 7.1.1
- flake8-bugbear: 24.8.19

<!-- Please give a short summary of the change and the problem this
solves. -->

## Related issue number

Closes ray-project#48065

<!-- For example: "Closes ray-project#1234" -->

## Checks

- [x] I've signed off every commit(by using the -s flag, i.e., `git
commit -s`) in this PR.
- [x] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for
https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I
added a
method in Tune, I've added it in `doc/source/tune/api/` under the
           corresponding `.rst` file.
- [ ] I've made sure the tests are passing. Note that there might be a
few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [ ] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(

Signed-off-by: win5923 <ken89@kimo.com>
Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
  • Loading branch information
win5923 authored and mohitjain2504 committed Nov 15, 2024
1 parent cd04b3f commit 14bf093
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion doc/source/serve/doc_code/tutorial_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
iris_dataset["target_names"],
)

np.random.shuffle(data), np.random.shuffle(target)
np.random.shuffle(data)
np.random.shuffle(target)
train_x, train_y = data[:100], target[:100]
val_x, val_y = data[100:], target[100:]
# __doc_data_end__
Expand Down
2 changes: 1 addition & 1 deletion python/ray/dashboard/head.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ async def _async_notify():
f"{dashboard_http_host}:{http_port}".encode(),
True,
namespace=ray_constants.KV_NAMESPACE_DASHBOARD,
),
)
self.gcs_client.internal_kv_put(
dashboard_consts.DASHBOARD_RPC_ADDRESS.encode(),
f"{self.ip}:{self.grpc_port}".encode(),
Expand Down
2 changes: 1 addition & 1 deletion python/ray/data/_internal/datasource/sql_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, sql: str, connection_factory: Callable[[], Connection]):
self.connection_factory = connection_factory

def estimate_inmemory_data_size(self) -> Optional[int]:
None
pass

def get_read_tasks(self, parallelism: int) -> List[ReadTask]:
def fallback_read_fn() -> Iterable[Block]:
Expand Down

0 comments on commit 14bf093

Please sign in to comment.