You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "TJaniF (via GitHub)" <gi...@apache.org> on 2023/03/02 13:40:18 UTC

[GitHub] [airflow] TJaniF commented on pull request #29842: Allow for templated args to be passed to the result_processor function in the GithubSensor fixing templated tags in GithubTagSensor

TJaniF commented on PR #29842:
URL: https://github.com/apache/airflow/pull/29842#issuecomment-1451881773

   @uranusjr if I change the default of `allow_templates_in_result_processor` to True in the GitHubSensor that means everyone who uses a custom operator using GitHubSensor.poke() with a `result_processor` function needs to have the `templated_fields` kwarg in that function. At least in my understanding this would be the only thing that breaks.
   
   For example this is the error that happens of the current GitHubTagSensor inherits from the BaseGithubRepositorySensor/GitHubSensor with the changes. 
   
   ```text
   [2023-03-02, 13:35:31 UTC] {taskinstance.py:1768} ERROR - Task failed with exception
   Traceback (most recent call last):
     File "/usr/local/lib/python3.9/site-packages/airflow/sensors/base.py", line 199, in execute
       poke_return = self.poke(context)
     File "/usr/local/airflow/include/custom_githubtagsensor.py", line 196, in poke
       return GithubSensor.poke(self, context=context)
     File "/usr/local/airflow/include/custom_githubtagsensor.py", line 68, in poke
       return self.result_processor(github_result, templated_fields=templated_fields)
   TypeError: tag_checker() got an unexpected keyword argument 'templated_fields'
   ```


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