sjyangkevin commented on issue #41641:
URL: https://github.com/apache/airflow/issues/41641#issuecomment-3863527224

   I just have a look for the `Variable.get` case. I think we should capture it 
in both `AIR311` and `AIR303` (through class method signature change).
   
   The module move from `airflow.models` to `airflow.sdk` is already captured 
in AIR311.
   
   
https://github.com/astral-sh/ruff/blob/56eb6b62936142c6ab2bdf0d7b864e32399e02a8/crates/ruff_linter/src/rules/airflow/rules/suggested_to_update_3_0.rs#L272-L279
   
   According to the documents:
   3.0.6: 
https://airflow.apache.org/docs/apache-airflow/3.0.6/core-concepts/variables.html
   2.11.0: 
https://airflow.apache.org/docs/apache-airflow/2.11.0/core-concepts/variables.html
   
   The class method is updated from
   >tag 2.11.0
   
   
https://github.com/apache/airflow/blob/d9ed7b94d033dc61ee1c05aafb9f1c1f7b82cfb2/airflow/models/variable.py#L126-L132
   
   to
   
   >main branch
   
   
https://github.com/apache/airflow/blob/71bc1dd0d25400a95b113252d11780821b8af0ac/task-sdk/src/airflow/sdk/definitions/variable.py#L47-L48
   
   I think the new rule can be added to AIR303, to detect if `default_var` is 
used when `Variable.get` is called, and when `Variable` is imported from 
`airflow.sdk`. @Lee-W what do you think?


-- 
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]

Reply via email to