digitalsimboja commented on a change in pull request #14400:
URL: https://github.com/apache/airflow/pull/14400#discussion_r588866190
##########
File path: airflow/upgrade/rules/fix_conf_not_importable_from_airflow.py
##########
@@ -0,0 +1,29 @@
+
+from airflow.upgrade.rules.base_rule import BaseRule
+
+print(BaseRule)
+
+<<<<<<< HEAD
+
+class ConfImportFromAirflow(BaseRule):
+ """
+ ConfImportFromAirflow class to ensure proper import of conf from to work
in Airflow 2.0
+ """
+ title = "Properly import conf from Airflow"
+ description = """\
+ In Airflow-2.0, it's not possible to import conf from airflow by using
\'import conf from airflow\'
+ To ensure your code works in Airflow 2.0, you should use \'from
airflow.Configuration import conf \'
+ """
+
+ def check(self):
+ from airflow import conf
+ if conf:
+ return (
+ "Warning: Properly import conf to ensure your code works in
AIrflow 2.0"
+ "From Airflow 2.0, you should use from airflow.Configuration
import conf."
+ )
Review comment:
Hi Turbaszek, I have updated the patch. Kindly review. 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.
For queries about this service, please contact Infrastructure at:
[email protected]