Skip to content

Commit 49edd5a

Browse files
authored
chore: update destination example script configuration to use GitHub and state cache (#659)
1 parent 47aa6d1 commit 49edd5a

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

examples/run_sync_to_destination_wo_cache.py

+20-6
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,26 @@
1818

1919

2020
def get_my_source() -> ab.Source:
21-
return ab.get_source(
22-
"source-faker",
21+
github_pat = ab.get_secret("GITHUB_PERSONAL_ACCESS_TOKEN")
22+
assert str(github_pat)
23+
source = ab.get_source(
24+
"source-github",
2325
config={
24-
"count": SCALE,
25-
"seed": 1234,
26-
"parallelism": 16,
26+
"repositories": ["airbytehq/PyAirbyte"],
27+
"credentials": {
28+
"personal_access_token": github_pat,
29+
},
2730
},
28-
streams=["purchases"],
31+
# streams=["issues"],
32+
)
33+
source.check()
34+
source.select_streams(["issues"])
35+
return source
36+
37+
38+
def get_cache() -> ab.DuckDBCache:
39+
return ab.new_local_cache(
40+
cache_name="state_cache",
2941
)
3042

3143

@@ -48,9 +60,11 @@ def main() -> None:
4860
source.check()
4961
destination = get_my_destination()
5062
destination.check()
63+
state_cache = get_cache()
5164
write_result: ab.WriteResult = destination.write(
5265
source,
5366
cache=False,
67+
state_cache=state_cache,
5468
)
5569
print(
5670
f"Completed writing {write_result.processed_records:,} records "

0 commit comments

Comments
 (0)