Skip to content

Follow the server's current /query/ contract - #41

Merged
pedroripper merged 3 commits into
masterfrom
pr/query-cursor
Nov 19, 2026
Merged

pedroripper merged 3 commits into
masterfrom
pr/query-cursor

Conversation

@pedroripper

@pedroripper pedroripper commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Brings the client in line with the current /query/ API.

Changes

  • Cursor paging. After the first page the client sends cursor=next_cursor instead of page, so later pages cost what the first one does. A server without cursors is still paged by number.
  • No client-side id tiebreaker. The server already makes every order total.
  • Table names. snake_case names are matched against the tables the caller's plan lists, since model names do not all follow one capitalisation pattern.
  • Dates across DST. reference_date columns are parsed with utc=True and converted to output_timezone (UTC when it is None); plain dates stay naive. Before, a result spanning a clock change raised under pandas 3.
  • Token. Surrounding whitespace is stripped, and initialize() raises when no token is configured.
  • 429. A 429 that asks to retry within seconds is waited out a few times; a longer one still raises at once.
  • get_schema raises LakehouseError instead of KeyError for a table that is not available.
  • Two stale aliases removed.
  • Docs: end date is inclusive, datetime_granularity is hour/day/month/year, join keys, enum spellings, page_size default, token required.

Behaviour changes for callers

  • No token → initialize() raises.
  • get_model_name contacts the API on first use.
  • reference_date dtype is now the named zone rather than a fixed offset.

Testing

  • Unit tests pass; integration tests skip cleanly without credentials.
  • Checked against the live API: cursor paging returns the same rows as a single page with no duplicates, ordering holds across pages, a range spanning a DST change parses, and table names resolve.

🤖 Generated with Claude Code

- Page by next_cursor instead of page numbers; a server that sends no
  cursor is still paged by number.
- Drop the client's id tiebreaker: the server already makes every order
  total.
- Resolve snake_case table names against the tables the caller's plan
  lists, since model names do not all follow one capitalisation.
- Parse reference_date with utc=True and convert to output_timezone, so a
  result spanning a DST change no longer raises under pandas 3.
- Strip the token, and refuse to initialize without one.
- Wait out a 429 that asks to retry within seconds; a longer one still
  raises at once.
- get_schema raises LakehouseError for a table that is not available.
- Docs: end date is inclusive, granularities are hour/day/month/year,
  join keys, enum spellings, page_size default, a token is required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pedroripper and others added 2 commits November 19, 2026 20:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pedroripper
pedroripper merged commit a629f0e into master Nov 19, 2026
2 checks passed
@pedroripper
pedroripper deleted the pr/query-cursor branch November 19, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant