-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Add description field to ConnectionResponse model (#52692) #52713
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
Add description field to ConnectionResponse model (#52692) #52713
Conversation
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'm not sure if the models should be perfectly shared between the execution api and the public api.
Maybe the execution api clients (workers etc.. do not need the description at all (yet))
Thanks for the input! I added the description field for completeness and consistency across UI, CLI, and API. If the execution API clients don’t need it, I’m happy to restrict it to the public API or update it based on your guidance. |
@@ -38,6 +38,7 @@ class ConnectionResponse(BaseModel): | |||
port: int | None | |||
password: str | None | |||
extra: str | None | |||
description: str | None = Field(default=None, description="Connection description") |
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.
Thanks @nrnavaneet for your first PR! There is already a description field in line 34. If you want to include Field description
, feel free, but since the field is str | None
, it should also default to None automatically, so I don't think the default=None
part is needed in this context.
description: str | None |
What do you think?
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 read to fast and thought this was a change in the execution API only datamodels.
ConnectionResponse
already has a description field. What are we trying to achieve?
I understand now. You're just modifying the wrong datamodel. What you are looking for is: I think the execution API has his whole set of Datamodels that are tailored specifically for the cc: @ashb |
Yeah, I don't know if |
Yeah it just to align description field with the actual connection model, thats fine if it is not required for the task-sdk return response we can ignore that. It just i observed when i was fixing the schema filed :) |
Thanks everyone for the clarification! As pointed out, the description field already exists in the public API model, and the execution API datamodels are intentionally lean and tailored for their use case. Since the description field is not required for execution API clients and doesn’t serve a functional purpose there, I’ll go ahead and close this PR. Really appreciate the review and discussion — this helped me understand the separation between the public and execution API models better! |
Thanks @nrnavaneet for your effort and comprehension, feel free to tackle any other unassigned issues, there are plenty of them and your help is very welcome! |
Thank You @pierrejeambrun |
This PR adds the missing
description
field to theConnectionResponse
model used in the execution API.Changes Made:
description
to the PydanticConnectionResponse
model inexecution_api/datamodels/connection.py
.execution_api/routes/connections.py
to include thedescription
in the API response.Why:
This change ensures that the API response fully represents the Airflow Connection object, aligning with the UI and CLI experience. It resolves issue #52692.
Let me know if further changes or tests are needed!