potiuk commented on a change in pull request #19377:
URL: https://github.com/apache/airflow/pull/19377#discussion_r744524493



##########
File path: airflow/providers/facebook/ads/hooks/ads.py
##########
@@ -119,25 +120,30 @@ def bulk_facebook_report(
         :type sleep_time: int
 
         :return: Facebook Ads API response, converted to Facebook Ads Row 
objects
-        :rtype: List[AdsInsights]
+        :rtype: Dict[str, List[AdsInsights]]

Review comment:
       We are VERY strict about backwards compatibility. And Hooks are equally 
part of the "public" API of providers as operators. Airflow is a very specific 
project in the sense that users are supposed to write code and use our Hooks 
and Operators in the way they think is the best. Due to their nature operators 
are very limited in what they can do but Hooks provide a much better interface 
for the users especially if they want to build some kind of transfer between 
two completely different services. I'd even say that in "modern" Airflow, 
Hoooks are WAY more important than Operators.
   
   Especially with the TaskFlow Api, where you can do something like that:
   
   ```
   @task 
   def trasnfer_from_fb_to_whatever():
      fbHook = FBHook()
      local_data = fbhook.read_data()
      transform_the_data( local_data)
      whatever_hook = WhateverHook()
      whatever_hook.send_data(local_data)
   ```
   
   This is fully-fledged Python task that uses Hooks and no operators and is 
the way modern tasks should be written in Airflow.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to