You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/07 23:19:50 UTC

[GitHub] [airflow] khalidmammadov opened a new pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

khalidmammadov opened a new pull request #20120:
URL: https://github.com/apache/airflow/pull/20120


   Part of https://github.com/apache/airflow/issues/19891
   
   Fixes various typing issues in airflow/www subfolder
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r766696032



##########
File path: airflow/www/extensions/init_appbuilder.py
##########
@@ -560,7 +561,7 @@ def security_converge(self, dry=False) -> Dict:
         :param dry: If True will not change DB
         :return: Dict with all computed necessary operations
         """
-        return self.sm.security_converge(self.baseviews, self.menu, dry)
+        return self.sm.security_converge(self.baseviews, self.menu, dry)  # type: ignore

Review comment:
       Fixed




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r764755792



##########
File path: airflow/www/views.py
##########
@@ -543,7 +543,7 @@ class AirflowBaseView(BaseView):
     }
 
     if not conf.getboolean('core', 'unit_test_mode'):
-        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'
+        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'  # type: ignore

Review comment:
       But yeah, this change is included in Ephraim's PR, so you'll need to rebase on top of that once it is merged.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r764757048



##########
File path: airflow/www/views.py
##########
@@ -543,7 +543,7 @@ class AirflowBaseView(BaseView):
     }
 
     if not conf.getboolean('core', 'unit_test_mode'):
-        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'
+        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'  # type: ignore

Review comment:
       Which I have just merged, so you can rebase now @khalidmammadov 




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r764571216



##########
File path: airflow/www/extensions/init_appbuilder.py
##########
@@ -560,7 +561,7 @@ def security_converge(self, dry=False) -> Dict:
         :param dry: If True will not change DB
         :return: Dict with all computed necessary operations
         """
-        return self.sm.security_converge(self.baseviews, self.menu, dry)
+        return self.sm.security_converge(self.baseviews, self.menu, dry)  # type: ignore

Review comment:
       What is the Mypy error this is ignoring?

##########
File path: airflow/www/views.py
##########
@@ -543,7 +543,7 @@ class AirflowBaseView(BaseView):
     }
 
     if not conf.getboolean('core', 'unit_test_mode'):
-        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'
+        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'  # type: ignore

Review comment:
       This will not be needed if we manage to resolve https://github.com/apache/airflow/pull/20096#pullrequestreview-825466253. (Not saying you should remove it right now, just a reminder to track changes there and adapt this PR is that’s merged first.)




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r764642038



##########
File path: airflow/www/views.py
##########
@@ -543,7 +543,7 @@ class AirflowBaseView(BaseView):
     }
 
     if not conf.getboolean('core', 'unit_test_mode'):
-        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'
+        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'  # type: ignore

Review comment:
       Ok, thanks for pointing out that PR, wasnt aware it's being fixed. I will rollback this file or
   
   > 
   
   Ok, thanks for pointing out that PR, wasnt aware it's being fixed. I will rollback this file

##########
File path: airflow/www/extensions/init_appbuilder.py
##########
@@ -560,7 +561,7 @@ def security_converge(self, dry=False) -> Dict:
         :param dry: If True will not change DB
         :return: Dict with all computed necessary operations
         """
-        return self.sm.security_converge(self.baseviews, self.menu, dry)
+        return self.sm.security_converge(self.baseviews, self.menu, dry)  # type: ignore

Review comment:
       Tried, still the same. I am not sure where that method is coming from, will need to dig deeper




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r764634282



##########
File path: airflow/www/extensions/init_appbuilder.py
##########
@@ -560,7 +561,7 @@ def security_converge(self, dry=False) -> Dict:
         :param dry: If True will not change DB
         :return: Dict with all computed necessary operations
         """
-        return self.sm.security_converge(self.baseviews, self.menu, dry)
+        return self.sm.security_converge(self.baseviews, self.menu, dry)  # type: ignore

Review comment:
       I think, it was complaining about security_covererage is not part of sm. As sm is dynamically loaded I set that to ignore




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] khalidmammadov commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
khalidmammadov commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r764634893



##########
File path: airflow/www/views.py
##########
@@ -543,7 +543,7 @@ class AirflowBaseView(BaseView):
     }
 
     if not conf.getboolean('core', 'unit_test_mode'):
-        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'
+        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'  # type: ignore

Review comment:
       Here, it cant resolve that bind is part of Session




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r764754390



##########
File path: airflow/www/views.py
##########
@@ -543,7 +543,7 @@ class AirflowBaseView(BaseView):
     }
 
     if not conf.getboolean('core', 'unit_test_mode'):
-        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'
+        extra_args['sqlite_warning'] = settings.Session.bind.dialect.name == 'sqlite'  # type: ignore

Review comment:
       ```suggestion
           extra_args['sqlite_warning'] = settings.engine.dialect.name == 'sqlite'
   ```




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on a change in pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#discussion_r764758098



##########
File path: airflow/www/extensions/init_appbuilder.py
##########
@@ -560,7 +561,7 @@ def security_converge(self, dry=False) -> Dict:
         :param dry: If True will not change DB
         :return: Dict with all computed necessary operations
         """
-        return self.sm.security_converge(self.baseviews, self.menu, dry)
+        return self.sm.security_converge(self.baseviews, self.menu, dry)  # type: ignore

Review comment:
       It may be better to fix the `sm = None` definition above (to `sm: AirflowSecurityManager`).




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk merged pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #20120:
URL: https://github.com/apache/airflow/pull/20120


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #20120: Fix various MyPy issues in airflow/www folder (part 1)

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #20120:
URL: https://github.com/apache/airflow/pull/20120#issuecomment-991031300


   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org