-
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
β¨ Source Pipedrive : Migrate Python CDK to Low-code CDK #29293
Conversation
Before Merging a Connector Pull RequestWow! What a great pull request you have here! π To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments.
"$schema": "http://json-schema.org/schema#", | ||
"type": "object", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why you remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcosmarxm added
paginator: | ||
type: NoPagination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is not using paginator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcosmarxm activity_types, currencies and permission_sets
does not have any clear pagination technique and nor they take any query parameter to get next page
So we have two ideas implementing NoPagination or removing this streams
whatever you suggest...
type: RecordSelector | ||
extractor: | ||
type: DpathExtractor | ||
field_path: ["data", "*", "data","*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
"success": true,
"data": [
{
"item": "user",
"id": 18047894,
"data": [
{
"id": 18047894,
"name": "Aviraj G",
"default_currency": "INR",
"timezone_name": "Asia/Kolkata",
"timezone_offset": "+05:30",
"locale": "en_US",
"email": "",
"phone": "",
"created": "2023-08-07 05:15:57",
"modified": "2023-08-11 20:44:25",
"lang": 1,
"active_flag": true,
"is_admin": 1,
"last_login": "2023-08-11 20:44:25",
"signup_flow_variation": "",
"role_id": 1,
"has_created_company": false,
"icon_url": null,
"is_you": true
}
]
},
{
"item": "user",
"id": 18105578,
"data": [
{
"id": 18105578,
"name": "Av",
"default_currency": "INR",
"timezone_name": "Asia/Kolkata",
"timezone_offset": "+05:30",
"locale": "en_US",
"email": "***",
"phone": null,
"created": "2023-08-12 09:23:56",
"modified": "2023-08-12 09:24:55",
"lang": 1,
"active_flag": true,
"is_admin": 0,
"last_login": "2023-08-12 09:24:55",
"signup_flow_variation": "",
"role_id": 1,
"has_created_company": false,
"icon_url": null,
"is_you": false
}
]
}
],
"additional_data": {
"since_timestamp": "2017-01-25 00:00:00",
"last_timestamp_on_page": "2023-08-12 09:24:55",
"pagination": {
"start": 0,
"limit": 2,
"more_items_in_collection": false
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Api response for user that's why used this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else read is throwing error
paginator: | ||
type: "DefaultPaginator" | ||
pagination_strategy: | ||
type: "PageIncrement" | ||
page_size: 50 | ||
page_token_option: | ||
type: "RequestOption" | ||
inject_into: "request_parameter" | ||
field_name: "page" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcosmarxm ya true thanks for mentioning,
we can implement cursorpagination
only in lead stream we cant implement cursorpagination
can you suggest anything else for lead stream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paginator:
type: "DefaultPaginator"
pagination_strategy:
type: "CursorPagination"
cursor_value: "{{ response['additional_data']['pagination']['next_start'] }}"
page_token_option:
type: "RequestOption"
inject_into: "request_parameter"
field_name: "start"
airbyte-integrations/connectors/source-pipedrive/source_pipedrive/source.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments.
tests: | ||
- config_path: "secrets/config.json" | ||
expect_records: | ||
path: "integration_tests/expected_records.jsonl" | ||
ignored_fields: | ||
users: | ||
- name: modified | ||
bypass_reason: "constantly increasing date-time field" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected_records.jsonl this file was old that's why I removed it and it will lead to failures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@avirajsingh7 that files is used to compare records when running integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for that I need to fix expected_records.jsonl file also according to latest schemas or I can keep old one?
- config_path: "integration_tests/invalid_config.json" | ||
status: "failed" | ||
discovery: | ||
tests: | ||
- config_path: "secrets/config.json" | ||
backward_compatibility_tests_config: | ||
disable_for_version: 0.1.19 | ||
disable_for_version: 1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not reason to change to breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to schema changes, I have done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be the case. For migrating a Beta/GA the schema should be broke right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove disable for version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please remove those lines.
backward_compatibility_tests_config: | ||
disable_for_version: 1.0.0 | ||
connection: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the same config as before.
Did you check my latest comments @avirajsingh7 ? |
"$schema": "http://json-schema.org/schema#", | ||
"type": "object", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcosmarxm added |
Thanks @avirajsingh7 the plans is to review your contribution next week. Meanwhile can you solve the conflicts your PR has? |
airbyte-integrations/connectors/source-pipedrive/source_pipedrive/manifest.yaml
Show resolved
Hide resolved
airbyte-integrations/connectors/source-pipedrive/source_pipedrive/spec.json
Show resolved
Hide resolved
|
||
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" | ||
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] | ||
|
||
LABEL io.airbyte.version=1.0.0 | ||
LABEL io.airbyte.version=2.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LABEL io.airbyte.version=2.0.0 | |
LABEL io.airbyte.version=1.1.0 |
- config_path: "integration_tests/invalid_config.json" | ||
status: "failed" | ||
discovery: | ||
tests: | ||
- config_path: "secrets/config.json" | ||
backward_compatibility_tests_config: | ||
disable_for_version: 0.1.19 | ||
disable_for_version: 1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please remove those lines.
tests: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" | ||
future_state: | ||
future_state_path: "integration_tests/abnormal_state.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests: | |
- config_path: "secrets/config.json" | |
configured_catalog_path: "integration_tests/configured_catalog.json" | |
future_state: | |
future_state_path: "integration_tests/abnormal_state.json" | |
tests: | |
- config_path: "secrets/config.json" | |
configured_catalog_path: "integration_tests/configured_catalog.json" | |
future_state: | |
future_state_path: "integration_tests/abnormal_state.json" |
connectorSubtype: api | ||
connectorType: source | ||
definitionId: d8286229-c680-4063-8c59-23b9b391c700 | ||
dockerImageTag: 1.0.0 | ||
dockerImageTag: 2.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dockerImageTag: 2.0.0 | |
dockerImageTag: 1.1.0 |
@@ -7,11 +7,13 @@ | |||
|
|||
MAIN_REQUIREMENTS = [ | |||
"airbyte-cdk~=0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"airbyte-cdk~=0.1", | |
"airbyte-cdk", |
TEST_REQUIREMENTS = [ | ||
"pytest~=6.2", | ||
"pytest-mock~=3.6.1", | ||
"connector-acceptance-test", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TEST_REQUIREMENTS = [ | |
"pytest~=6.2", | |
"pytest-mock~=3.6.1", | |
"connector-acceptance-test", | |
] | |
TEST_REQUIREMENTS = [ | |
"pytest~=6.2", | |
"pytest-mock~=3.6.1", | |
] |
url_base: "https://api.pipedrive.com/v1" | ||
http_method: "GET" | ||
request_parameters: | ||
api_token: "{{config['api_token']}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api_token: "{{config['api_token']}}" | |
api_token: "{{ config['authorization']['api_token'] }}" |
This is to maintain compatibility with current config.
cursor_field: "update_time" | ||
datetime_format: "%Y-%m-%d %H:%M:%S" | ||
start_datetime: | ||
datetime: "{{ config['replication_start_date'] }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datetime: "{{ config['replication_start_date'] }}" | |
datetime: "{{ format_datetime(config['replication_start_date'], '%Y-%m-%d %H:%M:%S') }}" |
spec: | ||
type: Spec | ||
documentation_url: https://docs.airbyte.com/integrations/sources/pipedrive | ||
connection_specification: | ||
title: Pipedrive Spec | ||
type: object | ||
required: | ||
- api_token | ||
- replication_start_date | ||
additionalProperties: true | ||
properties: | ||
api_token: | ||
title: API Token | ||
type: string | ||
description: The Pipedrive API Token. | ||
airbyte_secret: true | ||
replication_start_date: | ||
title: Start Date | ||
description: UTC date and time in the format 2017-01-25T00:00:00Z. Any data | ||
before this date will not be replicated. When specified and not None, then | ||
stream will behave as incremental | ||
examples: | ||
- '2017-01-25 00:00:00Z' | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spec: | |
type: Spec | |
documentation_url: https://docs.airbyte.com/integrations/sources/pipedrive | |
connection_specification: | |
title: Pipedrive Spec | |
type: object | |
required: | |
- api_token | |
- replication_start_date | |
additionalProperties: true | |
properties: | |
api_token: | |
title: API Token | |
type: string | |
description: The Pipedrive API Token. | |
airbyte_secret: true | |
replication_start_date: | |
title: Start Date | |
description: UTC date and time in the format 2017-01-25T00:00:00Z. Any data | |
before this date will not be replicated. When specified and not None, then | |
stream will behave as incremental | |
examples: | |
- '2017-01-25 00:00:00Z' | |
type: string | |
spec: | |
type: Spec | |
documentation_url: https://docs.airbyte.com/integrations/sources/pipedrive | |
connection_specification: | |
title: Pipedrive Spec | |
type: object | |
required: | |
- replication_start_date | |
additionalProperties: true | |
properties: | |
authorization: | |
type: object | |
title: API Key Authentication | |
required: | |
- api_token | |
properties: | |
api_token: | |
title: API Token | |
type: string | |
description: The Pipedrive API Token. | |
airbyte_secret: true | |
replication_start_date: | |
title: Start Date | |
description: UTC date and time in the format 2017-01-25T00:00:00Z. Any data | |
before this date will not be replicated. When specified and not None, then | |
stream will behave as incremental | |
examples: | |
- '2017-01-25 00:00:00Z' | |
type: string |
Hello, and thank you so much for contributing to the project during the Hackathon. Due to the high complexity of the code migration, we still have a few contributions open. I'm sending this message to update you that this contribution will be added to the final points we're going to announce tomorrow. With that said, we ask for your help to continue the process and finish the review. |
I am currently working on this in #30553 and hope to get it merged today if possible! |
Congrats! This was merged in #30553! |
What
Migrating Source pipedrive to Low-Code CDK
Closes #29135
How
Developed using (Configuration Based Source) low-code CDK
Recommended reading order
π¨ User Impact π¨
Are there any breaking changes? What is the end result perceived by the user?
Yes, there are breaking changes due to Changes in spec.yaml file
At many places previous data type were wrong and added some new properties in schema as per response from API
Test
Acceptance Test
Migrate Connector : Source Pipedrive