Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/providers/facebook/ads/hooks/ads.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def facebook_ads_config(self) -> Dict:
"""
self.log.info("Fetching fb connection: %s", self.facebook_conn_id)
conn = self.get_connection(self.facebook_conn_id)
config = conn.extra_dejson
config = {**conn.extra_dejson, "access_token": conn.password}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be some warning/message to the user noting that they should set access_token in the Connection's password attr rather than in Extras as well?

Side note, this hook desperately needs some documentation re: setting up a connection.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, or (if we decide setting the token in extras is acceptable), there should be some checks to make sure the empty password does not override the token in extras.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's appropriate for the access_token to be passed in the extra parameter since it is essentially the password for the Facebook API and should not be exposed. +1 need for documentation.

missing_keys = self.client_required_fields - config.keys()
if missing_keys:
message = f"{missing_keys} fields are missing"
Expand Down