Skip to content

Extract _prepare_unload() helper into BaseCursor#678

Merged
laughingman7743 merged 2 commits intomasterfrom
feature/670-prepare-unload
Feb 21, 2026
Merged

Extract _prepare_unload() helper into BaseCursor#678
laughingman7743 merged 2 commits intomasterfrom
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

laughingman7743 and others added 2 commits February 21, 2026 16:19
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 merged commit 5651427 into master Feb 21, 2026
5 checks passed
@laughingman7743 laughingman7743 deleted the feature/670-prepare-unload branch February 21, 2026 08:07
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.

Extract shared UNLOAD and execute() control flow into helper methods

1 participant