niclas_roos
02/02/2023, 9:35 AMr = younium.get_data(
endpoint='Subscriptions',
params={
'orderBy': 'id desc',
'Filter': "id gt guid'e0a6a6d4-9407-40c5-d041-08db03ef442c'"})
r.request.url -> '<https://api.younium.com/Subscriptions?orderBy=id+desc&Filter=id+gt+guid%27e0a6a6d4-9407-40c5-d041-08db03ef442c%27>'
my get_url_params looks like this:
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 = {"orderBy": "id asc"}
replication_key_value = self.get_starting_replication_key_value(context)
if next_page_token:
params["PageNumber"] = next_page_token
if replication_key_value:
params["Filter"] = f"id gt guid'{replication_key_value}'"
# print(params)
return params
it works when I run a full refresh but when I try "normal" refresh, it fails with this error: Bad Request for path: /Subscriptions
.
my guess is that params["Filter"] = f"id gt guid'{replication_key_value}'"
for some reason isn't parsed correctly, any advice how I can inspect the request url?niclas_roos
02/02/2023, 12:46 PMedgar_ramirez_mondragon
02/02/2023, 12:56 PMniclas_roos
02/02/2023, 12:57 PMniclas_roos
02/02/2023, 12:57 PMdef post_process(self, row: dict, context: Optional[dict]) -> dict:
"""As needed, append or transform raw data to match expected structure."""
replication_key_value = self.get_starting_replication_key_value(context)
if replication_key_value != row['id']:
row['legalEntity'] = self.config.get('legal_entity')
else:
row = None
return row
niclas_roos
02/02/2023, 12:59 PMniclas_roos
02/02/2023, 12:59 PM