Skip to content

Commit

Permalink
add primary key for insight streams (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnadolny13 authored Feb 1, 2024
1 parent 4233158 commit b244997
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tap_facebook/streams/ad_insights.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def __init__(self, *args, **kwargs) -> None: # noqa: ANN002, ANN003
kwargs["name"] = f"{self.name}_{self._report_definition['name']}"
super().__init__(*args, **kwargs)

@property
def primary_keys(self) -> list[str] | None:
return ["date_start", "account_id", "ad_id"] + self._report_definition["breakdowns"]

@staticmethod
def _get_datatype(field: str) -> th.Type | None:
d_type = AdsInsights._field_types[field] # noqa: SLF001
Expand Down

0 comments on commit b244997

Please sign in to comment.