Skip to content

Fix limit validation and send limit/format in Tables.export_raw - #95

Open
jirkasemmler wants to merge 1 commit into
masterfrom
fix-export-raw-limit-format
Open

jirkasemmler wants to merge 1 commit into
masterfrom
fix-export-raw-limit-format

Conversation

@jirkasemmler

Copy link
Copy Markdown
Contributor

Why

Tables.export_raw (and therefore export / export_to_file) had two related bugs around limit (#66):

  1. The validation was limit is not isinstance(table_id, int), so every non-None limit raised ValueError.
  2. Even with the validation fixed (as in Fix limit validation in Tables.export_raw #78), limit and file_format were never put into the request body, so a valid limit would be silently ignored and the whole table exported. That is worse than the current loud failure for export_to_file on large tables.

What

  • Validate limit as a positive int (bool excluded, 0/negative rejected).
  • Send limit and format in the export-async POST body.
  • Add mock tests in tests/mocks/test_tables.py asserting the posted body and the rejected values.

Fixes #66. Supersedes #78 (thanks @komackaj for the original fix).

🤖 Generated with Claude Code

The limit check compared the limit against isinstance(table_id, int),
so every non-None limit raised ValueError. On top of that, neither
limit nor format were ever added to the request body, so even a valid
limit would have been silently ignored and the whole table exported.

- validate limit as a positive int (bool excluded)
- send limit and format in the export-async request
- add mock tests asserting the posted body

Fixes #66
Supersedes #78

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jirkasemmler
jirkasemmler requested review from a team and zajca and removed request for a team September 29, 2026 08:36
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.

Limit in export_raw have invalid validation

2 participants