ashb commented on a change in pull request #17100:
URL: https://github.com/apache/airflow/pull/17100#discussion_r701792582
##########
File path: airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py
##########
@@ -100,15 +99,16 @@ def __init__(
self.facebook_conn_id = facebook_conn_id
self.api_version = api_version
self.fields = fields
- self.params = params
self.gzip = gzip
self.impersonation_chain = impersonation_chain
def execute(self, context: dict):
service = FacebookAdsReportingHook(
facebook_conn_id=self.facebook_conn_id,
api_version=self.api_version
)
- rows = service.bulk_facebook_report(params=self.params,
fields=self.fields)
+ rows = service.bulk_facebook_report(
+ params={k: v.resolve() for k, v in self.params.items()},
fields=self.fields
+ )
Review comment:
Oh right, gotcha.
I think the main thing here is that `dag.params` is so rarely used, that it
wasn't the "intended" behvaiour here, so this is likely a bug that just no one
has hit.
My main concern with this change is that because the providers are released
separately this would create a versioning nightmare where the old provider
can't work with new Airflow and vice-versa.
For example (all of these assuming a dag that does use `params):
- If you have the current provider and install airflow 2.2, then
`task.params` would end up with Param objects in them, not the "actual" values
- If you have Airflow 2.1 and install the next version of the provider that
includes this change, you'd get an error trying to call `resolve()` on a
`AttributeError: 'str' object has no attribute 'resolve'` (for example).
So is it possible to handle this entirely in core Airflow, not in the
operators, so that by the time `operator.execute()` gets it's hand on
`self.params` it is just the values, not the Param etc?
--
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]