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

mypy type checking with Ray fails due to syntax warning #48921

Open
bluenote10 opened this issue Nov 25, 2024 · 0 comments
Open

mypy type checking with Ray fails due to syntax warning #48921

bluenote10 opened this issue Nov 25, 2024 · 0 comments
Labels
bug Something that is supposed to be working; but isn't data Ray Data-related issues triage Needs triage (eg: priority, bug/not-bug, and owning component)

Comments

@bluenote10
Copy link

bluenote10 commented Nov 25, 2024

What happened + What you expected to happen

When type checking a project with mypy that use ray, the mypy type check prints warnings due to usages of invalid escape sequences in the Ray sources:

This is the output of running mypy . using ray 2.39.0:

/Users/.../lib/python3.12/site-packages/ray/data/grouped_data.py:350: SyntaxWarning: invalid escape sequence '\ '
  """Compute grouped min aggregation.
/Users/.../lib/python3.12/site-packages/ray/data/grouped_data.py:389: SyntaxWarning: invalid escape sequence '\ '
  """Compute grouped max aggregation.
/Users/.../lib/python3.12/site-packages/ray/data/grouped_data.py:428: SyntaxWarning: invalid escape sequence '\ '
  """Compute grouped mean aggregation.
/Users/.../lib/python3.12/site-packages/ray/data/grouped_data.py:470: SyntaxWarning: invalid escape sequence '\ '
  """Compute grouped standard deviation aggregation.

Our source files contains just an import ray and accesses ray.data.from_huggingface(...).

Looking at the master branch, the offending \ still seem to be there, but on different lines now:

... for i in range(100)]) \ # doctest: +SKIP
... .groupby("A") \ # doctest: +SKIP

Versions / Dependencies

ray==2.39.0
mypy==1.13.0

Reproduction script

import ray

dummy = None
ray.data.from_huggingface(dummy)

Issue Severity

None

@bluenote10 bluenote10 added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Nov 25, 2024
@jcotant1 jcotant1 added the core Issues that should be addressed in Ray Core label Nov 25, 2024
@jjyao jjyao added data Ray Data-related issues and removed core Issues that should be addressed in Ray Core labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't data Ray Data-related issues triage Needs triage (eg: priority, bug/not-bug, and owning component)
Projects
None yet
Development

No branches or pull requests

3 participants