potiuk commented on code in PR #44686:
URL: https://github.com/apache/airflow/pull/44686#discussion_r1874925027


##########
providers/src/airflow/providers/edge/version_compat.py:
##########
@@ -0,0 +1,38 @@
+# 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.
+#
+# NOTE! THIS FILE IS COPIED MANUALLY IN OTHER PROVIDERS DELIBERATELY TO AVOID 
ADDING UNNECESSARY
+# DEPENDENCIES BETWEEN PROVIDERS. IF YOU WANT TO ADD CONDITIONAL CODE IN YOUR 
PROVIDER THAT DEPENDS
+# ON AIRFLOW VERSION, PLEASE COPY THIS FILE TO THE ROOT PACKAGE OF YOUR 
PROVIDER AND IMPORT
+# THOSE CONSTANTS FROM IT RATHER THAN IMPORTING THEM FROM ANOTHER PROVIDER OR 
TEST CODE
+#
+
+from __future__ import annotations
+
+from packaging.version import Version
+
+
+def _get_base_airflow_version() -> Version:
+    from airflow import __version__
+
+    return Version(Version(__version__).base_version)

Review Comment:
   Yeah. The way it is changed now, makes it *easy* to change it as a follow-up 
- no more "common" code impact, dependencies etc., just common convention 
applied everywhere - and it can be easily changed now as we are guarding it a 
bit better and telling people what to do to add more compatibility code, so 
there is a chance both contributors and maintainers will stick to the 
convention. 
   
   Also - if the #44607 from @dstandish will follow the same (or introduce new 
- consistently) convention, the pre-commit code we have will guard that the new 
code added to airflow will not be used until we decide it's OK to use it 
(basically min-airlfow-version == 2.11) in this case.



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