From 57e0b18d9425bd2ff3d569508c768d48d13ca947 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Tue, 27 Oct 2026 14:14:05 +0100 Subject: [PATCH 1/2] docs: add a 1.0 upgrade guide and polish the package metadata --- README.md | 2 ++ UPGRADING.md | 55 ++++++++++++++++++++++++++++++++++ examples/apify_actor_call.py | 2 +- examples/apify_dataset_load.py | 2 +- pyproject.toml | 4 +-- 5 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 UPGRADING.md diff --git a/README.md b/README.md index be58739..74d106a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ The integration is available as the [`apify-haystack`](https://pypi.org/project/ pip install apify-haystack ``` +Upgrading from 0.1.x? See [UPGRADING.md](https://github.com/apify/apify-haystack/blob/main/UPGRADING.md). + ## Components - `ApifyDatasetFromActorCall` runs an Actor, waits for it to finish, and loads its default dataset. diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..f063ccb --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,55 @@ +# Upgrading to 1.0 + +Version 1.0 has breaking changes from 0.1.x. This guide covers each one and what to change in your code. For the full list of changes, see the [changelog](https://github.com/apify/apify-haystack/blob/main/CHANGELOG.md). + +## Python 3.11 or newer + +Support for Python 3.9 and 3.10 is dropped. The package supports Python 3.11 to 3.15. + +## Haystack 3 and apify-client 3 + +The package requires `haystack-ai>=3.0.0` and `apify-client>=3.4.0`. Haystack 3 has breaking changes of its own, so migrate the rest of your pipelines with it. If your code calls `apify-client` directly, update it for the 3.x API as well. + +Haystack 3 only deserializes classes and functions from trusted modules. To load a saved pipeline, pass `allowed_modules=['apify_haystack']` to `Pipeline.loads`, along with the module of your mapping function if you use a custom one. + +## The token parameter is `apify_token` and takes a `Secret` + +`ApifyDatasetFromActorCall` and `ApifyDatasetFromTaskCall` take the token as `apify_token`, a Haystack `Secret`. The `apify_api_token` string parameter is gone. + +```python +# 0.1.x +actor = ApifyDatasetFromActorCall('apify/website-content-crawler', mapping, apify_api_token='MY-TOKEN') + +# 1.0 +from haystack.utils import Secret + +actor = ApifyDatasetFromActorCall( + 'apify/website-content-crawler', mapping, apify_token=Secret.from_env_var('MY_APIFY_TOKEN') +) +``` + +If you set the token as an environment variable, you don't need to change anything. The components read `APIFY_TOKEN` first and fall back to `APIFY_API_TOKEN`. A missing token raises a `ValueError` when the component creates its client, on `warm_up` or the first `run`, not in `__init__`. + +`ApifyDatasetLoader` also takes `apify_token` now. Without a token, it can still load public datasets. + +## The client is created in `warm_up` + +The components follow the Haystack 3 lifecycle. Each one creates its Apify client in `warm_up`, or on the first `run`, and releases it in `close`. Before that, the `client` attribute is `None`. If your code used `component.client` right after creating the component, call `component.warm_up()` first. + +## Failed runs raise an error + +When an Actor or task run finishes with any status other than `SUCCEEDED`, `ApifyDatasetFromActorCall` and `ApifyDatasetFromTaskCall` raise a `RuntimeError`. In 0.1.x, they loaded whatever the run had written to its dataset. The error message includes the run ID and its status. + +## Import from the package root + +All modules are private. Import the public API from `apify_haystack`: + +```python +from apify_haystack import ApifyDatasetFromActorCall, ApifyDatasetFromTaskCall, ApifyDatasetLoader +``` + +The `apify_haystack.apify_dataset` and `apify_haystack.constants` modules are gone, and so is `apify_haystack.examples`. The examples are in the [examples directory](https://github.com/apify/apify-haystack/tree/main/examples) of the repository. + +## python-dotenv is not installed + +The package no longer depends on `python-dotenv`. If your code loads a `.env` file with it, add `python-dotenv` to your own dependencies. diff --git a/examples/apify_actor_call.py b/examples/apify_actor_call.py index 246406a..2744912 100644 --- a/examples/apify_actor_call.py +++ b/examples/apify_actor_call.py @@ -9,7 +9,7 @@ The script should produce the following output (an example of a single Document): ...... -Document(id=a617d376*****, content: 'Introduction to Haystack 2.x) +Document(id=a617d376*****, content: 'Introduction to Haystack Haystack is an open-source framework fo...', meta: {'url': 'https://docs.haystack.deepset.ai/docs/intro'} ..... """ diff --git a/examples/apify_dataset_load.py b/examples/apify_dataset_load.py index 7af2850..4295eae 100644 --- a/examples/apify_dataset_load.py +++ b/examples/apify_dataset_load.py @@ -7,7 +7,7 @@ The script should produce the following output (an example of a single Document): ...... -Document(id=a617d376*****, content: 'Introduction to Haystack 2.x) +Document(id=a617d376*****, content: 'Introduction to Haystack Haystack is an open-source framework fo...', meta: {'url': 'https://docs.haystack.deepset.ai/docs/intro'} ..... """ diff --git a/pyproject.toml b/pyproject.toml index 210cb2e..1978bfb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "uv_build" [project] name = "apify_haystack" version = "0.1.8" -description = "Apify-haystack integration" +description = "Apify integration for Haystack: load Actor results as Documents, search the web, and give Agents access to Apify Actors." authors = [{ name = "Apify Technologies s.r.o.", email = "support@apify.com" }] license = "Apache-2.0" license-files = ["LICENSE"] @@ -23,7 +23,7 @@ classifiers = [ "Topic :: Software Development :: Libraries", "Typing :: Typed", ] -keywords = ["apify", "crawler", "haystack", "rag", "scraper", "scraping"] +keywords = ["agents", "apify", "crawler", "haystack", "llm", "rag", "scraper", "scraping", "web-search"] dependencies = [ "apify-client>=3.4.0,<4.0.0", "haystack-ai>=3.0.0,<4.0.0", From b24b4bd626544023042c87e6f381874ec2888cc4 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Tue, 27 Oct 2026 14:15:36 +0100 Subject: [PATCH 2/2] docs: move the metadata and example fixes to their own PRs --- examples/apify_actor_call.py | 2 +- examples/apify_dataset_load.py | 2 +- pyproject.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/apify_actor_call.py b/examples/apify_actor_call.py index 2744912..246406a 100644 --- a/examples/apify_actor_call.py +++ b/examples/apify_actor_call.py @@ -9,7 +9,7 @@ The script should produce the following output (an example of a single Document): ...... -Document(id=a617d376*****, content: 'Introduction to Haystack +Document(id=a617d376*****, content: 'Introduction to Haystack 2.x) Haystack is an open-source framework fo...', meta: {'url': 'https://docs.haystack.deepset.ai/docs/intro'} ..... """ diff --git a/examples/apify_dataset_load.py b/examples/apify_dataset_load.py index 4295eae..7af2850 100644 --- a/examples/apify_dataset_load.py +++ b/examples/apify_dataset_load.py @@ -7,7 +7,7 @@ The script should produce the following output (an example of a single Document): ...... -Document(id=a617d376*****, content: 'Introduction to Haystack +Document(id=a617d376*****, content: 'Introduction to Haystack 2.x) Haystack is an open-source framework fo...', meta: {'url': 'https://docs.haystack.deepset.ai/docs/intro'} ..... """ diff --git a/pyproject.toml b/pyproject.toml index 1978bfb..210cb2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "uv_build" [project] name = "apify_haystack" version = "0.1.8" -description = "Apify integration for Haystack: load Actor results as Documents, search the web, and give Agents access to Apify Actors." +description = "Apify-haystack integration" authors = [{ name = "Apify Technologies s.r.o.", email = "support@apify.com" }] license = "Apache-2.0" license-files = ["LICENSE"] @@ -23,7 +23,7 @@ classifiers = [ "Topic :: Software Development :: Libraries", "Typing :: Typed", ] -keywords = ["agents", "apify", "crawler", "haystack", "llm", "rag", "scraper", "scraping", "web-search"] +keywords = ["apify", "crawler", "haystack", "rag", "scraper", "scraping"] dependencies = [ "apify-client>=3.4.0,<4.0.0", "haystack-ai>=3.0.0,<4.0.0",