Skip to content

Comments

Extract _prepare_unload() helper into BaseCursor#677

Closed
laughingman7743 wants to merge 1 commit intofeature/669-with-fetch-mixinfrom
feature/670-prepare-unload
Closed

Extract _prepare_unload() helper into BaseCursor#677
laughingman7743 wants to merge 1 commit intofeature/669-with-fetch-mixinfrom
feature/670-prepare-unload

Conversation

@laughingman7743
Copy link
Member

Summary

  • Extracts the duplicated UNLOAD preparation block (validate s3_staging_dir, wrap query via Formatter.wrap_unload()) into a single _prepare_unload() method on BaseCursor
  • Replaces 9 identical copies of the block (3 sync, 3 async, 3 aio cursor files) with a one-liner call
  • Adds return type annotation to Formatter.wrap_unload() to satisfy mypy

Net change: +48 / -119 lines (71 lines removed).

Closes #670

Test plan

  • make fmt passes
  • make chk passes (ruff lint + format + mypy)
  • make test passes (requires AWS credentials)

🤖 Generated with Claude Code

The UNLOAD preparation block (validate s3_staging_dir, wrap query with
UNLOAD statement) was duplicated character-for-character across 9 cursor
files. This consolidates the logic into a single _prepare_unload() method
on BaseCursor, which is pure computation and works for all cursor families
(sync, async, aio).

Also adds return type annotation to Formatter.wrap_unload() to satisfy mypy.

Closes #670

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@laughingman7743 laughingman7743 deleted the branch feature/669-with-fetch-mixin February 21, 2026 07:24
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