Skip to content

chore: update destination example script configuration to use GitHub and state cache #659

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

Merged
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
26 changes: 20 additions & 6 deletions examples/run_sync_to_destination_wo_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,26 @@


def get_my_source() -> ab.Source:
return ab.get_source(
"source-faker",
github_pat = ab.get_secret("GITHUB_PERSONAL_ACCESS_TOKEN")
assert str(github_pat)
source = ab.get_source(
"source-github",
config={
"count": SCALE,
"seed": 1234,
"parallelism": 16,
"repositories": ["airbytehq/PyAirbyte"],
"credentials": {
"personal_access_token": github_pat,
},
},
streams=["purchases"],
# streams=["issues"],
)
source.check()
source.select_streams(["issues"])
return source


def get_cache() -> ab.DuckDBCache:
return ab.new_local_cache(
cache_name="state_cache",
)


Expand All @@ -48,9 +60,11 @@ def main() -> None:
source.check()
destination = get_my_destination()
destination.check()
state_cache = get_cache()
write_result: ab.WriteResult = destination.write(
source,
cache=False,
state_cache=state_cache,
)
print(
f"Completed writing {write_result.processed_records:,} records "
Expand Down
Loading