You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "KoviAnusha (via GitHub)" <gi...@apache.org> on 2025/10/28 19:07:48 UTC
[PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
KoviAnusha opened a new pull request, #57452:
URL: https://github.com/apache/airflow/pull/57452
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2470809495
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
@@ -162,6 +162,7 @@ def unpause_backfill(backfill_id: NonNegativeInt, session: SessionDep) -> Backfi
raise HTTPException(status.HTTP_409_CONFLICT, "Backfill is already completed.")
if b.is_paused:
b.is_paused = False
+ session.commit()
Review Comment:
Is it needed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2492273548
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -244,7 +244,7 @@ def get_asset_aliases(
)
return AssetAliasCollectionResponse(
- asset_aliases=session.scalars(asset_aliases_select),
+ asset_aliases=list(session.scalars(asset_aliases_select)),
Review Comment:
@uranusjr , do you mean using asset_aliases=session.scalars(asset_aliases_select)?
If yes, I am getting the below error. So I used asset_aliases=list(session.scalars(asset_aliases_select))
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:250: error:
Argument "asset_aliases" to "AssetAliasCollectionResponse" has incompatible type
"ScalarResult[Any]"; expected "list[AssetAliasResponse]" [arg-type]
asset_aliases=session.scalars(asset_aliases_select),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2486735678
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
Review Comment:
I agree, there are still some modifications around the session which scares me
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2476501630
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
Review Comment:
As per the discussion with Jens, this has been removed.
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py:
##########
@@ -335,6 +334,12 @@ def update_xcom_entry(
)
# Update XCom entry
- xcom_entry.value = XComModel.serialize_value(xcom_new_value)
+ xcom_entry.value = XComModel.serialize_value(patch_body.value)
- return XComResponseNative.model_validate(xcom_entry)
+ # Create a copy and set the raw value like in the GET endpoint
+ import copy
+
+ item = copy.copy(xcom_entry)
+ item.value = xcom_entry.value
Review Comment:
As 'xcom_entry' is a SQLAlchemy model instance from the database. Directly modifying xcom_entry.value would mutate the original database object. To avoid mutation of the database object, I have used copy command.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2476516386
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -678,7 +678,7 @@ def delete_dag_asset_queued_event(
delete(AssetDagRunQueue).where(*where_clause).execution_options(synchronize_session="fetch")
)
result = session.execute(delete_statement)
- if result.rowcount == 0:
+ if cast("Any", result).rowcount == 0:
Review Comment:
```suggestion
result: Any = session.execute(delete_statement)
if result.rowcount == 0:
```
Would this work?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2488735449
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/variables.py:
##########
@@ -56,6 +56,7 @@
status_code=status.HTTP_204_NO_CONTENT,
responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
dependencies=[Depends(action_logging()), Depends(requires_access_variable("DELETE"))],
+ response_model=None,
Review Comment:
This should be changed to a return type annotation instead. (Same for the change below.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2490814474
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -244,7 +244,7 @@ def get_asset_aliases(
)
return AssetAliasCollectionResponse(
- asset_aliases=session.scalars(asset_aliases_select),
+ asset_aliases=list(session.scalars(asset_aliases_select)),
Review Comment:
Indeed, thanks for chiming in :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2532271758
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
@@ -86,7 +86,7 @@ def list_backfills(
session=session,
)
return BackfillCollectionResponse(
- backfills=session.scalars(select_stmt),
+ backfills=list(session.scalars(select_stmt).all()),
Review Comment:
https://apache-airflow.slack.com/archives/C06K9Q5G2UA/p1762320172286769
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2470921526
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
@@ -162,6 +162,7 @@ def unpause_backfill(backfill_id: NonNegativeInt, session: SessionDep) -> Backfi
raise HTTPException(status.HTTP_409_CONFLICT, "Backfill is already completed.")
if b.is_paused:
b.is_paused = False
+ session.commit()
Review Comment:
Is it a bug you experienced? Why did you decided to do that? It feels really weird to me to change something in the implementation although the PR focuses on fixing static annotations
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2471837595
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py:
##########
@@ -335,6 +334,12 @@ def update_xcom_entry(
)
# Update XCom entry
- xcom_entry.value = XComModel.serialize_value(xcom_new_value)
+ xcom_entry.value = XComModel.serialize_value(patch_body.value)
- return XComResponseNative.model_validate(xcom_entry)
+ # Create a copy and set the raw value like in the GET endpoint
+ import copy
+
+ item = copy.copy(xcom_entry)
+ item.value = xcom_entry.value
Review Comment:
Why?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2488797644
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/assets.py:
##########
@@ -48,7 +50,7 @@ def next_run_assets(
if latest_run and latest_run.logical_date:
on_clause = AssetEvent.timestamp >= latest_run.logical_date
else:
- on_clause = True
+ on_clause = literal(True)
Review Comment:
It’s probably easier to change this to `sqlalchemy.true()` instead
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2488703997
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -244,7 +244,7 @@ def get_asset_aliases(
)
return AssetAliasCollectionResponse(
- asset_aliases=session.scalars(asset_aliases_select),
+ asset_aliases=list(session.scalars(asset_aliases_select)),
Review Comment:
But we don’t need a list here. It would be better to change the type hint on AssetAliasCollectionResponse to take a Sequence instead.
Actually, I don’t think we even need `.all()` in the first place. Pydantic supports using simply Iterable, and ScalarResult would just work. Same for other similar cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2478373847
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -244,7 +244,7 @@ def get_asset_aliases(
)
return AssetAliasCollectionResponse(
- asset_aliases=session.scalars(asset_aliases_select),
+ asset_aliases=list(session.scalars(asset_aliases_select)),
Review Comment:
I think you still need to cast in list even though you are using `.all()`, at least I saw that in multiple PRs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2471835566
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -619,6 +620,7 @@ def delete_asset_queued_events(
@assets_router.delete(
"/dags/{dag_id}/assets/queuedEvents",
status_code=status.HTTP_204_NO_CONTENT,
+ response_model=None,
Review Comment:
I don’t think we need these since the PR already adds `-> None` to those functions. This parameter should only only needed if you return something different from the return type annotation.
https://fastapi.tiangolo.com/tutorial/response-model/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2485369178
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -678,7 +678,7 @@ def delete_dag_asset_queued_event(
delete(AssetDagRunQueue).where(*where_clause).execution_options(synchronize_session="fetch")
)
result = session.execute(delete_statement)
- if result.rowcount == 0:
+ if cast("Any", result).rowcount == 0:
Review Comment:
After the conflict resolution, this is taken care of
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2471651802
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
@@ -162,6 +162,7 @@ def unpause_backfill(backfill_id: NonNegativeInt, session: SessionDep) -> Backfi
raise HTTPException(status.HTTP_409_CONFLICT, "Backfill is already completed.")
if b.is_paused:
b.is_paused = False
+ session.commit()
Review Comment:
Got it. Thanks @jscheffl.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2471836489
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
Review Comment:
Why are there session handling changes in a Mypy PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2470850077
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
@@ -162,6 +162,7 @@ def unpause_backfill(backfill_id: NonNegativeInt, session: SessionDep) -> Backfi
raise HTTPException(status.HTTP_409_CONFLICT, "Backfill is already completed.")
if b.is_paused:
b.is_paused = False
+ session.commit()
Review Comment:
For consistency and to ensure the database transaction is properly committed when unpausing a backfill, the session.commit() is necessary in the unpause_backfill function. Without it, the change to b.is_paused = False might not be persisted to the database. Isn't my thought process right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ for Sqlalchemy 2 migration [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha commented on PR #57452:
URL: https://github.com/apache/airflow/pull/57452#issuecomment-3539433120
No mypy errors I am solving here. So closing PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ for Sqlalchemy 2 migration [airflow]
Posted by "KoviAnusha (via GitHub)" <gi...@apache.org>.
KoviAnusha closed pull request #57452: Fix MyPy type errors in api_fastapi routes/public/ for Sqlalchemy 2 migration
URL: https://github.com/apache/airflow/pull/57452
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2471071952
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
@@ -162,6 +162,7 @@ def unpause_backfill(backfill_id: NonNegativeInt, session: SessionDep) -> Backfi
raise HTTPException(status.HTTP_409_CONFLICT, "Backfill is already completed.")
if b.is_paused:
b.is_paused = False
+ session.commit()
Review Comment:
As long as no exception is raised the DB transaction is committing per default. As long as there is no "bug" reported we do not need an explicit commit() in my view.
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2476519904
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -244,7 +244,7 @@ def get_asset_aliases(
)
return AssetAliasCollectionResponse(
- asset_aliases=session.scalars(asset_aliases_select),
+ asset_aliases=list(session.scalars(asset_aliases_select)),
Review Comment:
Would `.all()` work? I think it would be slightly better than `list()` (which relies on `__iter__`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2476515320
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
Review Comment:
There are still a few changes left in this file. I think they should all be reverted?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MyPy type errors in api_fastapi routes/public/ & ui for Sqlalchemy 2 migration [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #57452:
URL: https://github.com/apache/airflow/pull/57452#discussion_r2478432183
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -244,7 +244,7 @@ def get_asset_aliases(
)
return AssetAliasCollectionResponse(
- asset_aliases=session.scalars(asset_aliases_select),
+ asset_aliases=list(session.scalars(asset_aliases_select)),
Review Comment:
See related [comment](https://github.com/apache/airflow/pull/57278/files#r2474242857)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org