Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-11 Thread via GitHub


potiuk merged PR #51603:
URL: https://github.com/apache/airflow/pull/51603


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-11 Thread via GitHub


jedcunningham commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139275844


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility

Review Comment:
   [This is the direction we've been moving for a 
while](https://lists.apache.org/thread/lktrzqkzrpvc1cyctxz7zxfmc0fwtq2j). It 
does initially feel weird though after years of the other direction :) 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-10 Thread via GitHub


amoghrajesh commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139312894


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility

Review Comment:
   Ah alright, thanks!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-10 Thread via GitHub


Lee-W commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139280987


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. The rules AIR301 and 
AIR302 indicate breaking changes in Airflow 3, while AIR311 and AIR312 
highlight changes that are not currently breaking but are strongly recommended 
for updates.
 
-The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.6``. The below example demonstrates how 
to check
-for dag incompatibilities that will need to be fixed before they will work as 
expected on Airflow 3.
+The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.13``. The below example demonstrates how 
to check for dag incompatibilities that will need to be fixed before they will 
work as expected on Airflow 3.
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --preview
+ruff check dags/ --select AIR301 --preview
 
 To preview the recommended fixes, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --show-fixes --preview
+ruff check dags/ --select AIR301 --show-fixes --preview
 
 Some changes can be automatically fixed. To do so, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --fix --preview
+ruff check dags/ --select AIR301 --fix --preview
 
 
+Some of the fixes are marked as unsafe. To trigger these fixes, run the 
following command:
+
+.. code-block:: bash
+
+ruff check dags/ --select AIR301 --fix --unsafe-fixes --preview
+
+Unsafe fixes usually do not break dag code. They're marked as safe as they may 
change some runtime behavior. For more information, see `Fix Safety 
`_.

Review Comment:
   sure 🙂 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-10 Thread via GitHub


Lee-W commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139280182


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility

Review Comment:
   @jedcunningham beats me haha, I was trying to search for this thread. Thanks!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-10 Thread via GitHub


Lee-W commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139278721


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. The rules AIR301 and 
AIR302 indicate breaking changes in Airflow 3, while AIR311 and AIR312 
highlight changes that are not currently breaking but are strongly recommended 
for updates.
 
-The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.6``. The below example demonstrates how 
to check
-for dag incompatibilities that will need to be fixed before they will work as 
expected on Airflow 3.
+The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.13``. The below example demonstrates how 
to check for dag incompatibilities that will need to be fixed before they will 
work as expected on Airflow 3.
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --preview
+ruff check dags/ --select AIR301 --preview
 
 To preview the recommended fixes, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --show-fixes --preview
+ruff check dags/ --select AIR301 --show-fixes --preview
 
 Some changes can be automatically fixed. To do so, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --fix --preview
+ruff check dags/ --select AIR301 --fix --preview
 
 
+Some of the fixes are marked as unsafe. To trigger these fixes, run the 
following command:
+
+.. code-block:: bash
+
+ruff check dags/ --select AIR301 --fix --unsafe-fixes --preview
+
+Unsafe fixes usually do not break dag code. They're marked as safe as they may 
change some runtime behavior. For more information, see `Fix Safety 
`_.
+
+In AIR rules, unsafe fixes involve changing import paths while keeping the 
name of the imported member the same. For instance, changing the import from 
``from airflow.sensors.base_sensor_operator import BaseSensorOperator`` to 
``from airflow.sdk.bases.sensor import BaseSensorOperator`` requires ruff to 
remove the original import before adding the new one. In contrast, safe fixes 
include changes to both the member name and the import path, such as changing 
``from airflow.datasets import Dataset`` to `from airflow.sdk import Asset``. 
These adjustments do not require ruff to remove the old import. To remove 
unused legacy imports, it is necessary to enable the `unused-import` rule 
(F401) .

Review Comment:
   put it to `.. note::` sounds like a good idea. Will update it
   
   According to the Ruff doc, I believe any runtime change should be marked as 
unsafe. `airflow.sensors.base_sensor_operator.BaseSensorOperator` is not 
entirely the same as `airflow.sdk.bases.sensor.BaseSensorOperator`, especially 
if users are checking the import path in some circumstances.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-10 Thread via GitHub


amoghrajesh commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139262447


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility

Review Comment:
   Hmmm -- not so sure about this one!



##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. The rules AIR301 and 
AIR302 indicate breaking changes in Airflow 3, while AIR311 and AIR312 
highlight changes that are not currently breaking but are strongly recommended 
for updates.
 
-The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.6``. The below example demonstrates how 
to check
-for dag incompatibilities that will need to be fixed before they will work as 
expected on Airflow 3.
+The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.13``. The below example demonstrates how 
to check for dag incompatibilities that will need to be fixed before they will 
work as expected on Airflow 3.

Review Comment:
   ```suggestion
   The latest available ``ruff`` version will have the most up-to-date rules, 
but be sure to use at least version ``0.11.13``. The below example demonstrates 
how to check 
   for dag incompatibilities that will need to be fixed before they will work 
as expected on Airflow 3.
   ```



##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. The rules AIR301 and 
AIR302 indicate breaking changes in Airflow 3, while AIR311 and AIR312 
highlight changes that are not currently breaking but are strongly recommended 
for updates.

Review Comment:
   ```suggestion
   To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. 
   The rules AIR301 and AIR302 indicate breaking changes in Airflow 3, while 
AIR311 and AIR312 highlight changes that are not currently breaking but are 
strongly recommended for updates.
   ```



##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize fricti

Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-10 Thread via GitHub


uranusjr commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139190955


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. The rules AIR301 and 
AIR302 indicate breaking changes in Airflow 3, while AIR311 and AIR312 
highlight changes that are not currently breaking but are strongly recommended 
for updates.
 
-The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.6``. The below example demonstrates how 
to check
-for dag incompatibilities that will need to be fixed before they will work as 
expected on Airflow 3.
+The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.13``. The below example demonstrates how 
to check for dag incompatibilities that will need to be fixed before they will 
work as expected on Airflow 3.
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --preview
+ruff check dags/ --select AIR301 --preview
 
 To preview the recommended fixes, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --show-fixes --preview
+ruff check dags/ --select AIR301 --show-fixes --preview
 
 Some changes can be automatically fixed. To do so, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --fix --preview
+ruff check dags/ --select AIR301 --fix --preview
 
 
+Some of the fixes are marked as unsafe. To trigger these fixes, run the 
following command:
+
+.. code-block:: bash
+
+ruff check dags/ --select AIR301 --fix --unsafe-fixes --preview
+
+Unsafe fixes usually do not break dag code. They're marked as safe as they may 
change some runtime behavior. For more information, see `Fix Safety 
`_.
+
+In AIR rules, unsafe fixes involve changing import paths while keeping the 
name of the imported member the same. For instance, changing the import from 
``from airflow.sensors.base_sensor_operator import BaseSensorOperator`` to 
``from airflow.sdk.bases.sensor import BaseSensorOperator`` requires ruff to 
remove the original import before adding the new one. In contrast, safe fixes 
include changes to both the member name and the import path, such as changing 
``from airflow.datasets import Dataset`` to `from airflow.sdk import Asset``. 
These adjustments do not require ruff to remove the old import. To remove 
unused legacy imports, it is necessary to enable the `unused-import` rule 
(F401) .

Review Comment:
   May be a good idea to put this in an info box (`.. note::` or `.. tip::`).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-10 Thread via GitHub


jedcunningham commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139182324


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. The rules AIR301 and 
AIR302 indicate breaking changes in Airflow 3, while AIR311 and AIR312 
highlight changes that are not currently breaking but are strongly recommended 
for updates.
 
-The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.6``. The below example demonstrates how 
to check
-for dag incompatibilities that will need to be fixed before they will work as 
expected on Airflow 3.
+The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.13``. The below example demonstrates how 
to check for dag incompatibilities that will need to be fixed before they will 
work as expected on Airflow 3.
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --preview
+ruff check dags/ --select AIR301 --preview
 
 To preview the recommended fixes, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --show-fixes --preview
+ruff check dags/ --select AIR301 --show-fixes --preview
 
 Some changes can be automatically fixed. To do so, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --fix --preview
+ruff check dags/ --select AIR301 --fix --preview
 
 
+Some of the fixes are marked as unsafe. To trigger these fixes, run the 
following command:
+
+.. code-block:: bash
+
+ruff check dags/ --select AIR301 --fix --unsafe-fixes --preview
+
+Unsafe fixes usually do not break dag code. They're marked as safe as they may 
change some runtime behavior. For more information, see `Fix Safety 
`_.

Review Comment:
   ```suggestion
   Unsafe fixes usually do not break dag code. They're marked as unsafe as they 
may change some runtime behavior. For more information, see `Fix Safety 
`_.
   ```



##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. The rules AIR301 and 
AIR302 indicate breaking changes in Airflow 3, while AIR311 and AIR312 
highlight changes that are not currently breaking but are strongly recommended 
for updates.
 
-The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.6``. The below example demonstrates how 
to check
-for dag incompatibilities that will need to be fixed before they will work as 
expected on Airflow 3.
+The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.13``. The below example demonstrates how 
to check for dag incompatibilities that will need to be fixed before they will 
work as expected on Airflow 3.
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --preview
+ruff check dags/ --select AIR301 --preview
 
 To preview the recommended fixes, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --show-fixes --preview
+ruff check dags/ --select AIR301 --show-

Re: [PR] docs(upgrading_to_airflow3): add instruction to use ruff >= 0.11.13 for more auto fixes [airflow]

2025-06-10 Thread via GitHub


Lee-W commented on code in PR #51603:
URL: https://github.com/apache/airflow/pull/51603#discussion_r2139138776


##
airflow-core/docs/installation/upgrading_to_airflow3.rst:
##
@@ -46,31 +46,40 @@ Step 2: Clean and back up your existing Airflow Instance
   ensure you deploy your changes to your old instance prior to upgrade, and 
wait until your dags have all been reprocessed
   (and all errors gone) before you proceed with upgrade.
 
-Step 3: DAG Authors - Check your Airflow DAGs for compatibility
+Step 3: Dag Authors - Check your Airflow dags for compatibility
 
 
-To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_.
+To minimize friction for users upgrading from prior versions of Airflow, we 
have created a dag upgrade check utility using `Ruff 
`_ combined with `AIR 
`_ rules. The rules AIR301 and 
AIR302 indicate breaking changes in Airflow 3, while AIR311 and AIR312 
highlight changes that are not currently breaking but are strongly recommended 
for updates.
 
-The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.6``. The below example demonstrates how 
to check
-for dag incompatibilities that will need to be fixed before they will work as 
expected on Airflow 3.
+The latest available ``ruff`` version will have the most up-to-date rules, but 
be sure to use at least version ``0.11.13``. The below example demonstrates how 
to check for dag incompatibilities that will need to be fixed before they will 
work as expected on Airflow 3.
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --preview
+ruff check dags/ --select AIR301 --preview
 
 To preview the recommended fixes, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --show-fixes --preview
+ruff check dags/ --select AIR301 --show-fixes --preview
 
 Some changes can be automatically fixed. To do so, run the following command:
 
 .. code-block:: bash
 
-ruff check dag/ --select AIR301 --fix --preview
+ruff check dags/ --select AIR301 --fix --preview
 
 
+Some of the fixes are marked as unsafe. To trigger these fixes, run the 
following command:
+
+.. code-block:: bash
+
+ruff check dags/ --select AIR301 --fix --unsafe-fixes --preview
+
+Unsafe fixes usually do not break dag code. They're marked as safe as they may 
change some runtime behavior. For more information, see `Fix Safety 
`_.
+
+In AIR rules, unsafe fixes involve changing import paths while keeping the 
name of the imported member the same. For instance, changing the import from 
``from airflow.sensors.base_sensor_operator import BaseSensorOperator`` to 
``from airflow.sdk.bases.sensor import BaseSensorOperator`` requires ruff to 
remove the original import before adding the new one. In contrast, safe fixes 
include changes to both the member name and the import path, such as changing 
``from airflow.datasets import Dataset`` to `from airflow.sdk import Asset``. 
These adjustments do not require ruff to remove the old import. To remove 
unused legacy imports, it is necessary to enable the `unused-import` rule 
(F401) .

Review Comment:
   Not sure whether this section contains too much information but this 
explains why some rules're unsafe fixes



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]