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 2020/06/29 16:18:22 UTC

[GitHub] [airflow] turbaszek commented on a change in pull request #9566: Fix using .json template extension in GMP operators

turbaszek commented on a change in pull request #9566:
URL: https://github.com/apache/airflow/pull/9566#discussion_r447092670



##########
File path: airflow/providers/google/marketing_platform/operators/campaign_manager.py
##########
@@ -298,6 +299,12 @@ def __init__(
         self.gcp_conn_id = gcp_conn_id
         self.delegate_to = delegate_to
 
+    def prepare_template(self) -> None:
+        # If .json is passed then we have to read the file
+        if isinstance(self.report, str) and self.report.endswith('.json'):

Review comment:
       According to documentation user should provide a dictionary so I would say that passing `str` don't have to be supported. 

##########
File path: airflow/providers/google/marketing_platform/operators/campaign_manager.py
##########
@@ -298,6 +299,12 @@ def __init__(
         self.gcp_conn_id = gcp_conn_id
         self.delegate_to = delegate_to
 
+    def prepare_template(self) -> None:
+        # If .json is passed then we have to read the file
+        if isinstance(self.report, str) and self.report.endswith('.json'):

Review comment:
       According to documentation user should provide a dictionary so I would say that passing `str` doesn't have to be supported. 




----------------------------------------------------------------
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:
users@infra.apache.org