Skip to content

Commit 0fc37aa

Browse files
committed
Minor fixes
1 parent 1ad1d1b commit 0fc37aa

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

sources/pipedrive/rest_v2/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""Pipedrive API v2 source using REST API v2 endpoints
2+
3+
Pipedrive API v2 docs: https://pipedrive.readme.io/docs/pipedrive-api-v2
4+
"""
5+
6+
17
from typing import Iterable, Dict, Any, List, Optional, Union, cast
28

39
import dlt
@@ -10,8 +16,8 @@
1016

1117
@dlt.source(name="pipedrive_v2")
1218
def pipedrive_v2_source(
13-
pipedrive_api_key: str = dlt.secrets.value,
14-
company_domain: str = dlt.secrets.value,
19+
pipedrive_api_key: Optional[str] = None,
20+
company_domain: Optional[str] = None,
1521
resources: Optional[List[str]] = None,
1622
prefix: str = "v2_",
1723
) -> Iterable[DltResource]:

sources/pipedrive_pipeline.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,14 @@ def load_v2_resources(resources: Optional[Sequence[str]] = None) -> None:
9090

9191

9292
def load_selected_v2_data() -> None:
93-
"""Load only the specified v2 entities (and their nested resources)."""
93+
"""Load only the specified v2 entities using `with_resources`."""
9494
pipeline = dlt.pipeline(
95-
pipeline_name="pipedrive21",
95+
pipeline_name="pipedrive",
9696
destination="duckdb",
97-
dataset_name="pipedrive_dat21a",
97+
dataset_name="pipedrive_data",
9898
progress="log",
9999
)
100-
# Use with_resources to select which entities to load (3 major v2 endpoints)
101-
# Note: v2 resources are prefixed with "v2_" in the source
100+
# Nested dependencies (e.g., v2_deal_products, v2_deal_followers) must be explicitly listed.
102101
load_info = pipeline.run(
103102
pipedrive_v2_source().with_resources(
104103
"v2_deals", "v2_persons", "v2_organizations"
@@ -110,12 +109,12 @@ def load_selected_v2_data() -> None:
110109

111110
if __name__ == "__main__":
112111
# run our main example
113-
# load_pipedrive()
112+
load_pipedrive()
114113
# load selected tables and display resource info
115114
# load_selected_data()
116115
# load activities updated since given date
117116
# load_from_start_date()
118117
# load v2 resources (optional addon)
119-
# load_v2_resources()
118+
load_v2_resources()
120119
# load only selected v2 resources (3 major endpoints: deals, persons, organizations)
121-
load_selected_v2_data()
120+
# load_selected_v2_data()

0 commit comments

Comments
 (0)