monika_rajput
08/02/2022, 3:01 PM"metadata": {
"next_page_info": "xxxxxxxxxxxxxxxx"
}
Error i am getting:
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Code i am using:
records_jsonpath = "$[*]" # Or override `parse_response`.
next_page_token_jsonpath = "$.next_page_info" # Or override `get_next_page_token`.
def get_next_page_token(
self, response: requests.Response, previous_token: Optional[Any]
) -> Optional[Any]:
"""Return a token for identifying next page or None if no more pages."""
# TODO: If pagination is required, return a token which can be used to get the
# next page. If this is the final page, return "None" to end the
# pagination loop.
if self.next_page_token_jsonpath:
all_matches = extract_jsonpath(
self.next_page_token_jsonpath, response.json()
)
print("all match ", all_matches)
first_match = next(iter(all_matches), None)
next_page_token = first_match
print("next_page_token....................", next_page_token)
else:
next_page_token = response.headers.get("page_info", None)
return next_page_token
def get_url_params(
self, context: Optional[dict], next_page_token: Optional[Any]
) -> Dict[str, Any]:
"""Return a dictionary of values to be used in URL parameterization."""
params: dict = {
}
if next_page_token:
params["page_info"] = next_page_token
params["per_page"] = 100
if self.replication_key:
params["sort"] = "asc"
params["order_by"] = self.replication_key
print("params ", params)
return paramsalexander_butler
08/02/2022, 3:06 PMmonika_rajput
08/02/2022, 3:55 PMnext_page_info token but still getting the error ERROR Loading failed (1): simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
meltano | DEBUG ELT could not be completed: Loader failed
I think something wrong in my json schema.monika_rajput
08/02/2022, 3:56 PMmonika_rajput
08/02/2022, 3:57 PMalexander_butler
08/02/2022, 3:58 PMalexander_butler
08/02/2022, 3:59 PMalexander_butler
08/02/2022, 4:02 PMalexander_butler
08/02/2022, 4:03 PMrecords_jsonpath = "$[*]" # Or override `parse_response`.monika_rajput
08/02/2022, 4:04 PMalexander_butler
08/02/2022, 4:09 PM$.metadata.next_page_info), it is impossible for the existing record path ($[*]) to be correct
Use this if you need to validate or figure out how jsonpath's evaluate, keep us posted on success!monika_rajput
08/02/2022, 6:09 PMERROR Unable to parse JSON: next_page_token.................... MTA0Njc4MDkyMiwxNjU5NDU2NDI2 ( This is the first token)
Below is the screenshot of response.monika_rajput
08/02/2022, 6:09 PMedgar_ramirez_mondragon
08/02/2022, 6:11 PMmeltano invoke <your tap> > singer.jsonl would confirm by looking at which lines are emitted by the tap.monika_rajput
08/02/2022, 6:59 PMmeltano --log-level=debug elt tap-yotpo redshift-pipelinewisemonika_rajput
08/02/2022, 9:06 PMmonika_rajput
08/02/2022, 9:06 PMalexander_butler
08/02/2022, 9:13 PM$[*]) against a sample response from the API using this tool I linked before? Need to rule this out just in casemonika_rajput
08/03/2022, 7:44 AM$.customers[*]alexander_butler
08/03/2022, 5:13 PMrecords_jsonpath in your tap to $.customers[*] ❓monika_rajput
08/04/2022, 6:15 AM