dstandish commented on code in PR #44610:
URL: https://github.com/apache/airflow/pull/44610#discussion_r1868405285


##########
providers/src/airflow/providers/common/compat/versions.py:
##########
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review Comment:
   yeah i think ultimately these constants to more harm than good.
   
   i think we should just chop em.  it's more readable to just do something 
like this example
   
   ```
           if _get_airflow_version() >= Version("2.11.0"):
               timeout = self.timeout
           else:
               timeout = timedelta(seconds=self.timeout)
   ```
   
   it's simple, it's explicit, it does not require any constants to be defined.
   
   wherever we have constants like this defined, we can add a single private 
helper function
   ```
   def _get_airflow_version():
       from airflow import __version__ as airflow_version
   
       return Version(Version(airflow_version).base_version)
   ```
   
   then when the min airflow version of the provider reaches 2.11, we can use 
the helper from core introduced in #44607
   
   wdyt



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