Skip to content
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

fix(data-warehouse): add missing config for salesforce incremental #25322

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
81 changes: 63 additions & 18 deletions posthog/temporal/data_imports/pipelines/salesforce/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"User": {
"name": "User",
"table_name": "user",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand All @@ -37,8 +42,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"UserRole": {
"name": "UserRole",
"table_name": "user_role",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand All @@ -58,8 +68,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"Lead": {
"name": "Lead",
"table_name": "lead",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand All @@ -79,8 +94,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"Contact": {
"name": "Contact",
"table_name": "contact",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand All @@ -100,8 +120,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"Campaign": {
"name": "Campaign",
"table_name": "campaign",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand All @@ -121,8 +146,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"Product2": {
"name": "Product2",
"table_name": "product2",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand All @@ -142,8 +172,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"Pricebook2": {
"name": "Pricebook2",
"table_name": "pricebook2",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand All @@ -163,8 +198,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"PricebookEntry": {
"name": "PricebookEntry",
"table_name": "pricebook_entry",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand All @@ -184,8 +224,13 @@ def get_resource(name: str, is_incremental: bool) -> EndpointResource:
"Order": {
"name": "Order",
"table_name": "order",
**({"primary_key": "id"} if is_incremental else {}),
"write_disposition": "replace",
**({"primary_key": "Id"} if is_incremental else {}),
"write_disposition": {
"disposition": "merge",
"strategy": "upsert",
}
if is_incremental
else "replace",
"endpoint": {
"data_selector": "records",
"path": "/services/data/v61.0/query",
Expand Down
Loading