Skip to content
Open
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
7 changes: 5 additions & 2 deletions tap_indeedsponsoredjobs/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def get_child_context(self, record: dict, context: Optional[dict]) -> dict:
return {
"_sdc_employer_id": record["id"],
}
# Leaving as a comment for now as this is nice for debugging
# def get_records(self, context: dict | None) -> Iterable[dict[str, Any]]:
# return [{"id": "id_here"}]


class EmployerStatsReport(IndeedSponsoredJobsStream):
Expand Down Expand Up @@ -95,7 +98,7 @@ class EmployerStatsReport(IndeedSponsoredJobsStream):
th.Property("_sdc_employer_id", th.StringType),
th.Property("_sdc_start_date", th.DateTimeType),
th.Property("_sdc_end_date", th.DateTimeType),
th.Property("_sdc_line_number", th.CustomType({"type": ["string", "null"]})),
th.Property("_sdc_line_number", th.StringType),
).to_dict()

def get_url_params(
Expand Down Expand Up @@ -219,7 +222,7 @@ def parse_response(self, response: requests.Response) -> Iterable[dict]:
record["_sdc_line_number"] = str(csv_data.line_num)
yield record
if has_data is False:
yield {"_sdc_line_number": None}
yield {"_sdc_line_number": "None"} #Because we're using this as a key_property most targets need a value here for primary keys to work



Expand Down