|
1 | 1 | # Changelog |
2 | 2 |
|
3 | | -## Unreleased |
| 3 | +## 3.2.0 (unreleased) |
4 | 4 |
|
5 | | -Phase 0 of the Diffbot SDKs' full HTTP API coverage plan: shared transport |
6 | | -foundation and a sync/async de-duplication refactor. No new API endpoints |
7 | | -land in this phase, and the package version is unchanged (per the plan's |
8 | | -scope, version bumps are deferred). |
| 5 | +Shared transport foundation, a sync/async de-duplication refactor, and DQL sent |
| 6 | +as a POST. The package version in `pyproject.toml` is bumped at release time. |
| 7 | + |
| 8 | +### Changed |
| 9 | + |
| 10 | +- **DQL is now sent as `POST` with a JSON body.** `dql()`, `dql_parallel()` and |
| 11 | + their async twins keep the same names, options, defaults and return values; |
| 12 | + only the wire format changes: `POST {dql_url}?token=…` with |
| 13 | + `{"query", "size", "from"?, "format"?, "filter"?, "exportspec"?, …extra}`. |
| 14 | + The token stays in the query string; the query text no longer appears in the |
| 15 | + URL, and the URL-length limit on long queries is gone. `extra` is now typed |
| 16 | + `Mapping[str, Any]` (values go into the JSON body verbatim). |
| 17 | +- `crawl()` failure now raises `JobError` (carrying the job name) instead of a |
| 18 | + synthesized `APIError(500, ...)`. `JobError` subclasses `APIError`. |
| 19 | + |
| 20 | +#### Migration note: mocks and proxies |
| 21 | + |
| 22 | +Test mocks keyed on `GET` and `?query=` stop matching. Before/after: |
| 23 | + |
| 24 | +```python |
| 25 | +# before (3.1.x) |
| 26 | +def handler(request: httpx.Request) -> httpx.Response: |
| 27 | + assert request.method == "GET" |
| 28 | + assert request.url.params["query"] == "type:Organization" |
| 29 | + return httpx.Response(200, json={"data": []}) |
| 30 | + |
| 31 | +# after (3.2.0) |
| 32 | +def handler(request: httpx.Request) -> httpx.Response: |
| 33 | + assert request.method == "POST" |
| 34 | + assert json.loads(request.content)["query"] == "type:Organization" |
| 35 | + return httpx.Response(200, json={"data": []}) |
| 36 | +``` |
| 37 | + |
| 38 | +GET-only proxies, caches, or a custom `dql_url` mirror may reject or not cache |
| 39 | +POSTs. If you need the old wire format, use the low-level call (no new API): |
| 40 | + |
| 41 | +```python |
| 42 | +db.request("GET", db.dql_url, params={"token": db.token, "query": q, "size": 10}) |
| 43 | +``` |
| 44 | + |
| 45 | +or pin `diffbot<3.2`. |
9 | 46 |
|
10 | 47 | ### Added |
11 | 48 |
|
|
0 commit comments