Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ differences being today's row, which grows as the day elapses.
### Added

- **`themeparks-backfill`: the archive download as a command.** It was an example
to copy off GitHub. The first paying customer followed that link and had to
work out that the library needed installing, then what the arguments were,
then read a traceback. Now:
to copy off GitHub. Anyone following that link had to work out that the
library needed installing, then what the arguments were, then read a
traceback. Now:

```bash
pip install themeparks
Expand Down
6 changes: 3 additions & 3 deletions examples/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
themeparks-backfill "Walt Disney World Resort" # every park in a destination
themeparks-backfill --list disney # find an id, no key needed

It used to be a script to copy off GitHub. The first paying customer to follow
that link had to work out that the library needed installing, then what the
arguments were, then read a traceback. It is a command now, with `--help` that
It used to be a script to copy off GitHub. Anyone following that link had to
work out that the library needed installing, then what the arguments were, then
read a traceback. It is a command now, with `--help` that
answers those questions, so there is nothing here to copy.

The code lives at `themeparks/backfill.py` and is the same logic, tested.
Expand Down
3 changes: 1 addition & 2 deletions tests/fixtures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ this project keeps repeating.
On 2026-09-28 a 403-recovery fix shipped doing nothing. Its tests passed because
the fixture was built from the *formatted text of a traceback* rather than from a
response body, so the code and the test were wrong together and agreed with each
other. The memory note for that pattern is `self-confirming-harness`, and it was
its fifth occurrence in one day.
other.

A fixture the author of the code also invented proves only that the two are
consistent. A fixture taken from the real thing can disagree.
Expand Down
13 changes: 6 additions & 7 deletions tests/unit/test_backfill.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
"""The packaged backfill command, driven against a stub client.

WHY THIS EXISTS, AND WHY IT FAILED ONCE ALREADY. This is the first code a paying
customer runs. Nothing tested it until 2026-09-28, when the first real customer
hit a nine-frame traceback on their first attempt: the range started at
`span.archive_from` (what the archive holds) while their Pro key reached back 400
days, so the FIRST request was refused.
WHY THIS EXISTS, AND WHY IT FAILED ONCE ALREADY. This is the first code many
users run. It once had no tests, and a first run ended in a nine-frame
traceback: the range started at `span.archive_from` (what the archive holds)
while the key reached back 400 days, so the FIRST request was refused.

Then the first version of these tests PASSED against a broken fix. The recovery
read `earliestAllowedDate` off the top level of the error body; the API nests it
under `error`. The fixture had been built from the formatted text in the
customer's traceback rather than from a real response, so the code and the test
under `error`. The fixture had been built from the formatted text in that
traceback rather than from a real response, so the code and the test
shared one wrong assumption and agreed with each other. It shipped doing nothing.

So the body below is captured from production verbatim, and TestFixtureIsReal
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_backfill_incremental.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""`themeparks-backfill` over time: a date range, reruns that add new days, and
only final days in the file.

Three defects from one customer-style run of 4.0.1, each reproduced before it
Three defects from one end-to-end run of 4.0.1, each reproduced before it
was fixed:

1. No way to ask for less than everything. A key that reaches the whole archive
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ class TestApiKey:
"""The library could not send a key at all until 2026-09-23.

That capped the official SDK at the anonymous window, seven days of
history and the unauthenticated rate limit, so a paying customer had to
drop to raw HTTP to use what they had bought. These pin it shut.
history and the unauthenticated rate limit, so a caller with a key had to
drop to raw HTTP to use it. These pin it shut.
"""

def _capture(self, seen):
Expand Down
4 changes: 2 additions & 2 deletions themeparks/_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def _headers(user_agent: str, api_key: str | None) -> dict[str, str]:

The SDK could not send a key at all until 2026-09-23, which meant the
official library could reach only the anonymous window: seven days of
history and the unauthenticated rate limit. A paying customer had to drop
to raw HTTP to use what they had bought.
history and the unauthenticated rate limit. A caller with a key had to drop
to raw HTTP to use it.

`x-api-key` is the header the API documents. Nothing here logs or repeats
the value.
Expand Down
9 changes: 4 additions & 5 deletions themeparks/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
python -m themeparks.backfill "Disneyland Park" # same thing

WHY THIS IS IN THE PACKAGE RATHER THAN AN EXAMPLE TO COPY. It used to be
`examples/backfill.py` on GitHub, linked from the docs. The first paying customer
followed that link and had to work out that the library needed installing, then
what the arguments were, then read a traceback. Every one of those is a wall
between someone who has paid for the archive and the archive. A recipe you have
to reconstruct is not a recipe; this is one command.
`examples/backfill.py` on GitHub, linked from the docs. Anyone following that
link had to work out that the library needed installing, then what the arguments
were, then read a traceback. Every one of those is a wall between a user and the
archive. A recipe you have to reconstruct is not a recipe; this is one command.

What it does that is easy to get wrong by hand:

Expand Down