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

[typing] prefect.tasks and prefect.task_worker #16332

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Dec 11, 2024

related to #16292

fixes a circular import problem related to imports of Task in async_dispatch

some assorted other fixes to pass the check

@github-actions github-actions bot added the development Tech debt, refactors, CI, tests, and other related work. label Dec 11, 2024
Copy link

codspeed-hq bot commented Dec 11, 2024

CodSpeed Performance Report

Merging #16332 will not alter performance

Comparing fix-some-task-worker-typing (199a165) with main (33339e1)

Summary

✅ 3 untouched benchmarks

@zzstoatzz zzstoatzz force-pushed the fix-some-task-worker-typing branch 3 times, most recently from 1e13b8e to e04574a Compare December 11, 2024 04:50
@zzstoatzz zzstoatzz self-assigned this Dec 11, 2024
whaaaa

thank you

fix secret block description
@zzstoatzz zzstoatzz force-pushed the fix-some-task-worker-typing branch from e04574a to dd4340d Compare December 11, 2024 05:30
src/prefect/_internal/pydantic/v2_validated_func.py Outdated Show resolved Hide resolved
src/prefect/_internal/pydantic/v2_validated_func.py Outdated Show resolved Hide resolved
src/prefect/deployments/runner.py Outdated Show resolved Hide resolved
src/prefect/deployments/runner.py Outdated Show resolved Hide resolved
src/prefect/task_worker.py Outdated Show resolved Hide resolved
src/prefect/task_worker.py Outdated Show resolved Hide resolved
@@ -362,7 +388,7 @@ async def __aenter__(self):
self._started_at = pendulum.now()
return self

async def __aexit__(self, *exc_info):
async def __aexit__(self, *exc_info: Any):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot the return annotation 😀

Suggested change
async def __aexit__(self, *exc_info: Any):
async def __aexit__(self, *exc_info: Any) -> Optional[bool]

Or just None or bool as applicable.

Copy link
Collaborator Author

@zzstoatzz zzstoatzz Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, maybe I'm missing your point but this __aexit__ doesn't return

src/prefect/tasks.py Outdated Show resolved Hide resolved
src/prefect/tasks.py Outdated Show resolved Hide resolved
src/prefect/tasks.py Outdated Show resolved Hide resolved
hide isinstance
@zzstoatzz zzstoatzz force-pushed the fix-some-task-worker-typing branch from 3f3c464 to 199a165 Compare December 11, 2024 14:43
@zzstoatzz zzstoatzz marked this pull request as ready for review December 11, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Tech debt, refactors, CI, tests, and other related work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants