From 93c06365f5e1ab459146055aea1c4c3bee1fc30b Mon Sep 17 00:00:00 2001 From: "Aaron (\"AJ\") Steers" Date: Fri, 2 Feb 2024 09:35:15 -0800 Subject: [PATCH] AirbyteLib: fix examples in getting started (#34762) --- airbyte-lib/examples/run_faker.py | 6 ++---- .../airbyte-lib/getting-started.mdx | 16 ++++++---------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/airbyte-lib/examples/run_faker.py b/airbyte-lib/examples/run_faker.py index c9f0db1e6ba0..55d1017ed393 100644 --- a/airbyte-lib/examples/run_faker.py +++ b/airbyte-lib/examples/run_faker.py @@ -17,15 +17,13 @@ source = ab.get_connector( "source-faker", - pip_url="-e ../airbyte-integrations/connectors/source-faker", config={"count": SCALE / 2}, install_if_missing=True, ) source.check() source.set_streams(["products", "users", "purchases"]) -cache = ab.new_local_cache() -result = source.read(cache) +result = source.read() -for name, records in result.cache.streams.items(): +for name, records in result.streams.items(): print(f"Stream {name}: {len(list(records))} records") diff --git a/docs/using-airbyte/airbyte-lib/getting-started.mdx b/docs/using-airbyte/airbyte-lib/getting-started.mdx index 6c568fd28129..c203116867fc 100644 --- a/docs/using-airbyte/airbyte-lib/getting-started.mdx +++ b/docs/using-airbyte/airbyte-lib/getting-started.mdx @@ -13,7 +13,7 @@ pip install airbyte-lib Or during the beta, you may want to install the latest from from source with: ```bash -pip install 'git+airbytehq/airbyte.git@master#egg=airbyte-lib&subdirectory=airbyte-lib' +pip install 'git+https://www.github.com/airbytehq/airbyte.git@master#egg=airbyte-lib&subdirectory=airbyte-lib' ``` ## Usage @@ -24,19 +24,15 @@ Data can be extracted from sources and loaded into caches: import airbyte_lib as ab source = ab.get_connector( - "source-spacex-api", - config={"id": "605b4b6aaa5433645e37d03f"}, + "source-faker", + config={"count": 5_000}, install_if_missing=True, ) source.check() +result = source.read() -source.set_streams(["launches", "rockets", "capsules"]) - -cache = ab.new_local_cache() -result = source.read_all(cache) - -for name, records in result.cache.streams.items(): - print(f"Stream {name}: {len(records)} records") +for name, records in result.streams.items(): + print(f"Stream {name}: {len(list(records))} records") ``` ## API Reference