diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba66080..ec49856 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,27 @@ permissions: contents: read jobs: + # Both clients post `party_totals: false` for the default cut. Production must + # accept that key before either client publishes. + preflight: + runs-on: ubuntu-latest + defaults: + run: + working-directory: python + steps: + - uses: actions/checkout@v7 + + - name: Install uv + uses: astral-sh/setup-uv@v10.0.0 + + - name: Set up Python 3.12 + run: uv python install '3.12' + + - name: Check that production accepts party_totals + run: uv run --python 3.12 python ../scripts/release_preflight.py + python: + needs: preflight if: startsWith(github.ref_name, 'python-v') runs-on: ubuntu-latest environment: @@ -41,6 +61,7 @@ jobs: run: uv publish typescript: + needs: preflight if: startsWith(github.ref_name, 'typescript-v') runs-on: ubuntu-latest environment: diff --git a/contract/SOURCE b/contract/SOURCE index f2aa164..4dd6ae6 100644 --- a/contract/SOURCE +++ b/contract/SOURCE @@ -1 +1 @@ -4ad77392b3ca9ae61d4c0522981878682d7d2b90 +2f7462a91408a18ff2bf97872fed735a8c052382 diff --git a/python/CHANGELOG.md b/python/CHANGELOG.md index 4668897..b0f699e 100644 --- a/python/CHANGELOG.md +++ b/python/CHANGELOG.md @@ -8,25 +8,33 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ### Added -- `data.party_totals_left_out` names the group totals a fetch left out of each member, as `dfo.types.PartyTotalsLeftOut` entries of spec id, party role, dcids and provenance, and the repr counts them. `data.save` writes them under a new `dfo.party_totals_left_out` key, which 0.1.0 ignores, and `dfo.load` reads a file without it. -- `entities=` on `fetch` and `answer.fetch` takes the `Match` and `Entity` objects `dfo.lookup.resolve` returns beside dcids, as in `entities={"destination": dfo.lookup.resolve("Nigeria")}`. A match that is not `resolved` raises `InvalidRequestError` (`invalid_argument`) before any request, printing the match and a candidate to pass instead. An awaitable in its place, such as `client.lookup.resolve(...)` on an `AsyncClient` without `await`, raises the same error and names the missing `await`. +- `data.party_totals_left_out` names the group totals a fetch left out of each member, as `dfo.types.PartyTotalsLeftOut` entries of spec id, party role, dcids, provenance and `kept_in`, the series whose rows kept those totals, each a `dfo.types.KeptSeries` of the series' cells and the periods in which it kept them. `role_key` names the `entities=` key of the entry's column, `origin` or `destination`, or None for a column the client does not know. The repr counts the totals on each role with its role key, as `15 on financingProvider (origin)`. Entries keep the manifest's order, and two can share a role and a provenance. `data.save` writes them under a new `dfo.party_totals_left_out` key, with `kept_in` where an entry holds it, which 0.1.0 ignores, and `dfo.load` reads a file without it. +- A derived Dataset reports the party totals each reading's read left out, from the derived manifest's `roots[].party_totals_left_out`, each entry named by the reading's spec id in the order of the ref's roots, and its repr's line reads `Party totals left out of the readings`. The report is empty against a server older than it and when DFO could not read a reading. +- `docs/datasets.md` says when the default keeps a total. A role the spec binds keeps what it binds. On an open role the cut judges each series, the frame's columns other than the role, `time_period` and provenance, in each period: a period with single parties drops its totals, a period of only totals keeps its whole ones, and with none whole it drops them when the series has single parties in another period and keeps them otherwise. +- `entities=` on `fetch` and `answer.fetch` takes the `Match` and `Entity` objects `dfo.lookup.resolve` returns beside dcids, as in `entities={"destination": dfo.lookup.resolve("Nigeria")}`. A match that is not `resolved` raises `InvalidRequestError` (`match_unresolved`) before any request, printing the match and a candidate to pass instead. An awaitable in its place, such as `client.lookup.resolve(...)` on an `AsyncClient` without `await`, raises the same error and names the missing `await`. - `docs/settings.md` lists every client option and environment variable with its default and which source wins. - `data.to_bytes()` returns the Parquet file `data.save(path)` writes, and `dfo.load` reads those bytes, or any bytes-like object such as a `bytearray` or `memoryview`, as it reads a path. - `data.from_cache` says whether a fetch read any member's file from the cache, and `data.fetched_at` when the data left the server, in UTC. The repr adds `Cached: read from the cache, fetched