-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No code connector builder] cannot use next_page_token in request JSON body interpolation #40697
Comments
A few things going on here! First off, thank you A LOT for such a detailed report. I'm supporting our Connector Builder team, I'll take a look later today + tomorrow. Out of curiosity, I see you're building against Intercom. Is there any reason why you can's use our source-intercom connector? Any missing streams / columns there? I would love to help and add the missing pieces in Intercom proper, as we're migrating it to low-code. And to the point — I'll try to get our sandbox credentials and run the queries you're trying to run and see if I can reproduce the problem. |
Hi Natik, thanks for looking into this. |
Looked into this and I think I found the root cause:
What does make me sure that the issue is somewhere on the line of code I shared above is that when I add incremental sync to the stream (and thus make it so that the CDK doesn't create a Basically all we added was this block to the stream definition:
We should probably keep the issue open until the CDK fix is merged. But I think we are unblocked for now. full yamlversion: 2.0.0type: DeclarativeSource check: definitions: streams:
spec: metadata: schemas: |
I also made a probably-not-entirely-correct PR adding this stream to the existing Intercom connector |
@brianjlai, any chance you can pick this up? /cc @girarda |
@natikgadzhi probably not, i'm mostly focused on the automatic RFR stuff for the time being |
I've had the same issue and found the "next_page_token" attribute is available in the "stream_partition" object. Not sure if this is a workaround or new method, as via next_page_token object it was not working for me either when trying to update a no code custom connector, under Text (Free Form) request body. |
/cc @lmossman I think this is an interesting one. Am I right to assume that a solution is to pass next page token to interpolation context dicts in the CDK side? |
@natikgadzhi based on the comment above it sounds like this may already be doable with |
An update to the comment above, this workaround is not working when there is a "Parent Stream" or "Parameterized Requests" is being used. In this case the contents of "stream_partition" do not contain the "next_page_token". This became a blocker for one particular use case we have. |
@natikgadzhi @maxi297 could you look into why the |
@natikgadzhi @maxi297 @lmossman - any update on this please? I have a feeling that instead of making the next_page_token available under the dict named "next_page_token", it is being made available under a dict named "stream_partition" |
I can take a stab at solving this if someone can guide me to where to look? |
…next_page_token to solve airbytehq/airbyte#40697 for now
I noticed this recently when rebuilding the Pardot source. On streams set to Incremental, What I noticed though was that if I enabled Parameterized Requests with a dummy value, Hopefully this helps track things down a bit more. I would argue that the right solution is fixing |
Topic
Possible bug with next_page_token interpolation (Airbyte Cloud)
Relevant information
Issue description
When I try to use the next_page_token variable in a freeform json request body, it is not interpolated and as a result not set in the outgoing request
Here is the request body:
Here is the paginator:
Here is the response:
Here is the request for the second page (which I would expect to have the starting_after WITHIN pagination, not outside of it as shown):
Full YAML
`version: 2.0.0type: DeclarativeSource
check:
type: CheckStream
stream_names:
- intercom tickets
definitions:
streams:
intercom tickets:
type: DeclarativeStream
next_page_token: '{{ $.response.pages.next.starting_after}}'
name: intercom tickets
retriever:
type: SimpleRetriever
requester:
$ref: '#/definitions/base_requester'
path: /tickets/search
http_method: POST
request_headers:
Content-Type: application/json
Intercom-Version: '2.11'
request_body_json:
query:
operator: AND
value:
- field: created_at
operator: '>'
value: '1306054154'
pagination:
per_page: 20
starting_after: '{{next_page_token}}'
record_selector:
type: RecordSelector
extractor:
type: DpathExtractor
field_path:
- tickets
paginator:
type: DefaultPaginator
page_token_option:
type: RequestOption
inject_into: body_json
field_name: starting_after
pagination_strategy:
type: CursorPagination
cursor_value: >-
{{ response.get("pages", {}).get("next", {}).get("starting_after",
{}) }}
stop_condition: >-
{{ not response.get("pages", {}).get("next",
{}).get("starting_after", {}) }}
schema_loader:
type: InlineSchemaLoader
schema:
$ref: '#/schemas/intercom tickets'
base_requester:
type: HttpRequester
url_base: https://api.intercom.io/
authenticator:
type: BearerAuthenticator
api_token: '{{ config["api_key"] }}'
streams:
spec:
type: Spec
connection_specification:
type: object
$schema: http://json-schema.org/draft-07/schema#
required:
- api_key
properties:
api_key:
type: string
order: 0
title: API Key
airbyte_secret: true
additionalProperties: true
metadata:
autoImportSchema:
intercom tickets: true
schemas:
intercom tickets:
type: object
$schema: http://json-schema.org/schema#
additionalProperties: true
properties:
type:
type:
- string
- 'null'
admin_assignee_id:
type:
- string
- 'null'
category:
type:
- string
- 'null'
contacts:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
contacts:
type:
- array
- 'null'
items:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
external_id:
type:
- string
- 'null'
id:
type:
- string
- 'null'
created_at:
type:
- number
- 'null'
id:
type:
- string
- 'null'
is_shared:
type:
- boolean
- 'null'
linked_objects:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
data:
type:
- array
- 'null'
items:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
id:
type:
- string
- 'null'
has_more:
type:
- boolean
- 'null'
total_count:
type:
- number
- 'null'
open:
type:
- boolean
- 'null'
team_assignee_id:
type:
- string
- 'null'
ticket_attributes:
type:
- object
- 'null'
properties:
Order Identifier:
type:
- number
- 'null'
Partner / Sirdab:
type:
- string
- 'null'
Sirdab SKU:
type:
- number
- 'null'
Type of Order:
type:
- string
- 'null'
default_description:
type:
- string
- 'null'
default_title:
type:
- string
- 'null'
ticket_id:
type:
- string
- 'null'
ticket_parts:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
ticket_parts:
type:
- array
- 'null'
items:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
assigned_to:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
id:
type:
- string
- 'null'
attachments:
type:
- array
- 'null'
items:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
content_type:
type:
- string
- 'null'
filesize:
type:
- number
- 'null'
name:
type:
- string
- 'null'
url:
type:
- string
- 'null'
author:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
email:
type:
- string
- 'null'
id:
type:
- string
- 'null'
name:
type:
- string
- 'null'
body:
type:
- string
- 'null'
created_at:
type:
- number
- 'null'
external_id:
type:
- string
- 'null'
id:
type:
- string
- 'null'
part_type:
type:
- string
- 'null'
previous_ticket_state:
type:
- string
- 'null'
redacted:
type:
- boolean
- 'null'
ticket_state:
type:
- string
- 'null'
updated_at:
type:
- number
- 'null'
total_count:
type:
- number
- 'null'
ticket_state:
type:
- string
- 'null'
ticket_state_external_label:
type:
- string
- 'null'
ticket_state_internal_label:
type:
- string
- 'null'
ticket_type:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
archived:
type:
- boolean
- 'null'
category:
type:
- string
- 'null'
created_at:
type:
- number
- 'null'
description:
type:
- string
- 'null'
icon:
type:
- string
- 'null'
id:
type:
- string
- 'null'
is_internal:
type:
- boolean
- 'null'
name:
type:
- string
- 'null'
ticket_type_attributes:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
data:
type:
- array
- 'null'
items:
type:
- object
- 'null'
properties:
type:
type:
- string
- 'null'
archived:
type:
- boolean
- 'null'
created_at:
type:
- number
- 'null'
data_type:
type:
- string
- 'null'
default:
type:
- boolean
- 'null'
description:
type:
- string
- 'null'
id:
type:
- string
- 'null'
input_options:
type:
- object
- 'null'
properties:
list_options:
type:
- array
- 'null'
items:
type:
- object
- 'null'
properties:
archived:
type:
- boolean
- 'null'
id:
type:
- string
- 'null'
label:
type:
- string
- 'null'
multiline:
type:
- boolean
- 'null'
name:
type:
- string
- 'null'
order:
type:
- number
- 'null'
required_to_create:
type:
- boolean
- 'null'
required_to_create_for_contacts:
type:
- boolean
- 'null'
ticket_type_id:
type:
- number
- 'null'
updated_at:
type:
- number
- 'null'
visible_on_create:
type:
- boolean
- 'null'
visible_to_contacts:
type:
- boolean
- 'null'
workspace_id:
type:
- string
- 'null'
updated_at:
type:
- number
- 'null'
workspace_id:
type:
- string
- 'null'
updated_at:
type:
- number
- 'null'
`
The text was updated successfully, but these errors were encountered: