|
| 1 | +# S2 leftovers (Python) |
| 2 | + |
| 3 | +S2 (plan §2, §6, §8; Python 3.4.0) landed on `feat/sdk-s2`, stacked on `feat/sdk-s1`. |
| 4 | +`pyproject.toml` is not bumped (release-time). |
| 5 | + |
| 6 | +## Landed |
| 7 | + |
| 8 | +- DQL named params (`type`, `col`, `filter_exclude`, `exportseparator`, `exportfile`, |
| 9 | + `jsonmode`, `non_canonical_facts`, `no_dedup_articles`, `cluster`), POST body, `extra` |
| 10 | + collision -> `ValidationError`, forwarded by `dql_parallel`. |
| 11 | +- Crawl-create named options and `custom_headers: str | Sequence[str]`. |
| 12 | +- `nlp()` (sync/async) on the NL endpoint; `entities()` untouched. |
| 13 | +- Web search: 1-5 `text` values, `snippet_length` validation. |
| 14 | +- Ontology: `dql_fetch_ontology_text`, `dql_refresh_ontology_async`. |
| 15 | +- Live cases: web search (single/2-value `text`), entities + nlp. |
| 16 | + |
| 17 | +## Deliberately narrower than the plan |
| 18 | + |
| 19 | +- **DQL overloads use `**options: Unpack[DqlOptions]`** (type-level only, like extract); |
| 20 | + the implementation has explicit keyword parameters. |
| 21 | +- **`extra` collision applies to the new named keys only.** Existing keys (`size`, |
| 22 | + `from`, `format`, `filter`, `exportspec`) can still be overridden through `extra`, as |
| 23 | + before; changing that would be a behaviour change outside S2. A named option whose |
| 24 | + value is `None` does not collide, so `extra={"jsonmode": ...}` keeps working. |
| 25 | +- **`crawl()` has no `extra`**, so `repeat`/`maxRounds`/`seedRecrawlFrequency`/ |
| 26 | + `onlyProcessIfNew` are simply unreachable (per the task, no new backdoor). |
| 27 | + `Diffbot.crawl` still takes `**kwargs: Any`, so the new names are not type-checked |
| 28 | + there. `use_canonical` is sent as `1`/`0` only when set. |
| 29 | +- **`nlp()` response is one `NlpResponse` TypedDict** (all fields optional), not a |
| 30 | + per-`fields` `Pick`. `facts`/`records`/`categories`/`sentences` are `List[Any]`. |
| 31 | + `custom_summary` uses the Python key `max_number_of_sentences` (wire |
| 32 | + `maxNumberOfSentences`); the 1-10 range is left to the server. |
| 33 | +- **Async refresh naming:** on `DiffbotAsync` it is `dql_refresh_ontology` (no suffix, |
| 34 | + like `dql_fetch_ontology`); `dql_refresh_ontology_async` is the `diffbot.kg` function. |
| 35 | +- `snippet_length` stays typed as the lowercase `SnippetLength` Literal; uppercase input |
| 36 | + is accepted at runtime only. |
| 37 | +- `crawl_get_job` still returns `{}` for a missing job (TS: `undefined`); unchanged. |
| 38 | + |
| 39 | +## Unverified |
| 40 | + |
| 41 | +- Live tests (`pytest -m live`) were not run in this session, including the two new |
| 42 | + cases. Not confirmed against the real API: `nlp()` `documentType`/`customSummary` |
| 43 | + placement inside the document object (taken from the docs), repeated `text=` on the |
| 44 | + live web search endpoint, repeated `customHeaders` on the crawl create, and |
| 45 | + `type=crawl` DQL requests. |
| 46 | +- The TypeScript S2 counterpart was not present when this was written, so field-for-field |
| 47 | + parity (names, validation messages) is unchecked beyond `snippetLength`. |
| 48 | +- Plan §11 open question about DQL POST parity is still open (see `S1_LEFTOVERS.md`). |
0 commit comments