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/08/04 10:49:20 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #17408: Fix the issue #17371 to load the file contents

uranusjr commented on a change in pull request #17408:
URL: https://github.com/apache/airflow/pull/17408#discussion_r682504788



##########
File path: airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py
##########
@@ -71,7 +71,7 @@ def execute(self, context):
             group=self.api_group,
             version=self.api_version,
             plural="sparkapplications",
-            body=self.application_file,
+            body=open(self.application_file).read(),

Review comment:
       Don’t do this. Use either `with open(...)` or `pathlib.Path(...).read_text()` instead.
   
   Also, please specify `encoding="utf8")`.




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