-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
AIP-84: Migrate get_log endpoint #44238
base: main
Are you sure you want to change the base?
Conversation
5d29904
to
6996c71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice thanks !
A few suggestions and ready to merge :)
tests/api_fastapi/core_api/routes/public/test_task_instances.py
Outdated
Show resolved
Hide resolved
tests/api_fastapi/core_api/routes/public/test_task_instances.py
Outdated
Show resolved
Hide resolved
tests/api_fastapi/core_api/routes/public/test_task_instances.py
Outdated
Show resolved
Hide resolved
tests/api_fastapi/core_api/routes/public/test_task_instances.py
Outdated
Show resolved
Hide resolved
tests/api_fastapi/core_api/routes/public/test_task_instances.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Pierre Jeambrun <[email protected]>
Co-authored-by: Pierre Jeambrun <[email protected]>
Co-authored-by: Pierre Jeambrun <[email protected]>
Co-authored-by: Pierre Jeambrun <[email protected]>
Co-authored-by: Kalyan R <[email protected]>
dag_id: str, | ||
dag_run_id: str, | ||
task_id: str, | ||
task_try_number: int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
task_try_number: int, | |
task_try_number: NonNegativeInt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can import this from pydantic
from pydantic import NonNegativeInt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will automatically raise 422. We don't need to separately check if its less than 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try_number: int = 1
Let's add a default try number value. and just try_number
is sufficient. There is no need for the task_
prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot that try_number can be >0. In that case, we should use PositiveInt
if task_try_number <= 0: | ||
raise HTTPException(status.HTTP_400_BAD_REQUEST, "task_try_number must be a positive integer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if task_try_number <= 0: | |
raise HTTPException(status.HTTP_400_BAD_REQUEST, "task_try_number must be a positive integer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick, after addressing @rawwar suggestions, should be good to merge.
|
||
@task_instances_log_router.get( | ||
"/{task_id}/logs/{task_try_number}", | ||
responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are missing the documentation for text/plain
mimetype.
Related: #42370