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

let typing be compatible with python 3.8 #13288

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dlee992
Copy link

@dlee992 dlee992 commented May 8, 2024

Hi, when I import prefect_ray with python 3.8, I met a typing error:

python -c "import prefect_ray as pr; print(pr.__file__, pr.__version__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".../.venv/lib/python3.8/site-packages/prefect_ray/__init__.py", line 6, in <module>
    from .task_runners import RayTaskRunner  # noqa
  File ".../.venv/lib/python3.8/site-packages/prefect_ray/task_runners.py", line 91, in <module>
    class RayTaskRunner(BaseTaskRunner):
  File ".../.venv/lib/python3.8/site-packages/prefect_ray/task_runners.py", line 157, in RayTaskRunner
    call: Callable[..., Awaitable[State[R]]],
TypeError: 'ModelMetaclass' object is not subscriptable

So I tried to give a fix about this issue. prefect_dask has the similar issue I think.
Not sure where to add a test for this.

@dlee992 dlee992 requested review from desertaxle, zzstoatzz and a team as code owners May 8, 2024 20:47
Copy link

netlify bot commented May 8, 2024

👷 Deploy request for prefect-docs-preview pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 01a26c6

@desertaxle
Copy link
Member

Thanks for the PR @dlee992! I think we'll need to stagger these changes since the change in the core prefect need to be release before we can use them in integrations packages. Can you update this PR to only update the prefect package and then open a separate PR to update prefect-dask and prefect-ray?

@dlee992
Copy link
Author

dlee992 commented May 10, 2024

Sure! I can do that.

BTW, need to ask first: does prefect want to accept this PR, given python 3.8 will go to the end of its lifecycle in Oct, 2024. I mean after that time, this PR shouldn't be needed any more, then perhaps incur a revert PR for this.

Perhaps no bother to solve this issue, just put this PR as a temp patch if anyone wants to use prefect_ray/dask with 3.8

@desertaxle
Copy link
Member

Great question! We are planning on dropping support for 3.8 in the next few months. We are also planning on updating our task runner interface soon which would resolve this issue.

I'd be happy to accept a PR that fixes the typing in prefect-ray and prefect-dask, but let's scope the changes to only prefect-ray and prefect-dask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants