prefect icon indicating copy to clipboard operation
prefect copied to clipboard

let typing be compatible with python 3.8

Open dlee992 opened this issue 9 months ago • 4 comments

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 avatar May 08 '24 20:05 dlee992

Deploy request for prefect-docs-preview pending review.

Visit the deploys page to approve it

Name Link
Latest commit 01a26c6bc13b116908df979d31fd22009febfa02

netlify[bot] avatar May 08 '24 20:05 netlify[bot]

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?

desertaxle avatar May 10 '24 18:05 desertaxle

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

dlee992 avatar May 10 '24 18:05 dlee992

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.

desertaxle avatar May 15 '24 14:05 desertaxle

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

github-actions[bot] avatar May 29 '24 15:05 github-actions[bot]

This pull request was closed because it has been stale for 14 days with no activity. If this pull request is important or you have more to add feel free to re-open it.

github-actions[bot] avatar Jun 12 '24 16:06 github-actions[bot]