Skip to content

[4.x] Backport #1540, #1533, #1535, #1537 and #1545 - #1554

Merged
laughingman7743 merged 32 commits into
4.xfrom
backport/4.x-1540-1545
Nov 30, 2026
Merged

laughingman7743 merged 32 commits into
4.xfrom
backport/4.x-1540-1545

Conversation

@laughingman7743

@laughingman7743 laughingman7743 commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

WHAT

The third batch of the 4.x backports decided in #1327 (comment): the filesystem fixes of #1340 and #1341 merged after #1534, in master merge order. Each commit is a git cherry-pick -x of the master commit.

Follows #1553 (merged); the branch was updated with 4.x after that merge, with no change to its tree.

Master PR Issue Commits Change on 4.x
#1540 (af68e72) #1519 56c1deb, 815718f (2 of 3) du() takes its sizes from the listed entries instead of a HeadObject per object; one walk body for walk()/_walk(), which ignore keyword arguments other than detail, refresh and versions.
#1533 (aa0b127) #1472 all 7, item 1 left out A map stops when an enclosing stop scope is stopped; counts classifies each failure once; no further item is taken after a failure.
#1535 (23c068e) #1522 all 8 touch(truncate=False) sends IfNoneMatch="*" and looks the key up without the cache; multipart copies of an unversioned source pin its ETag; S3Core.call() rewinds a streamed payload before a retry.
#1537 (c035200) #1526 all 7 The write session's abort after NoSuchUpload, a queued creation after a stop, two interrupts during abort(), one interrupt during discard(), and the size of the last part.
#1545 (fc8c0cf) #1527 all 7 Response fields that the models dropped, ListMultipartUploads of directory buckets, URL-encoded key markers, S3Object copies, and repr() without request parameters.

Partial ports, by decision (#1327 and the maintainer, 2026-11-30):

Conflicts. Resolved with each commit's own delta only, and recorded in the commit messages:

Release notes (from the master PRs, for 4.x):

WHY

#1327 decided to backport the fixes merged to master after the 4.x cut in one session, in master merge order. This PR continues after #1553.

TEST

Tested commit: 0afe623, on #1553's head; the current head 37cd1b3 (4.x merged in) has the same tree.

  • just lint and just docs lint: passed.
  • Offline tests/pyathena -m "not aws" (dummy credentials and an unreachable endpoint, so no AWS request is sent): 4021 passed (3909 on [4.x] Backport #1489, #1478, #1480, #1501, #1515 and #1534 #1553's head).
  • Not run locally: the AWS integration tests. They run in CI when this PR is marked Ready.

🤖 Generated with Claude Code

laughingman7743 and others added 30 commits November 30, 2026 00:37
du() and AioS3FileSystem._du() looked up every entry that find() listed
with info(), which sent HeadObject for each object that no cached
listing held: three objects listed with maxdepth=None cost one
ListObjectsV2 and three HeadObject requests, a version_aware filesystem
looked up every object, and with withdirs each directory that no cached
listing held cost a further HeadObject, and a ListObjectsV2 unless an
object of its name existed.

Count the size of each listed entry instead, named by its bucket and key
without a version, so that a requested version keeps the key bucket/key
that info() gives it. The sizes of the entries of one name are added:
the directory of an object that is also a key prefix counts nothing,
where the lookup of its name counted the object below the path as well.
A directory is named by its key, so the directory bucket/d/ of the key
d//x counts under its name whatever maxdepth is, where the lookup
without maxdepth named it bucket/d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 56c1deb)
…ds (GH-1519)

S3FileSystem._walk_tree() and AioS3FileSystem._walk_directory() held the
same walk, and the keyword arguments of walk(), which fsspec passes to
ls(), reached their private parameters: walk(path, yield_failed=True)
yielded a failed listing in S3FileSystem and raised TypeError in the
sync walk() of AioS3FileSystem, and directory="x" raised AttributeError
or TypeError.

_walk_steps() is now the one walk. It does no I/O: it yields the path or
the listed directory to list and is sent the entries, or the OSError of
the listing, so that S3FileSystem lists in the calling thread and
AioS3FileSystem._walk() awaits each listing in a thread of the
filesystem and calls on_error in the event loop, as before. The walk
entry points read detail, refresh and versions and ignore the other
keyword arguments, as ls() does. _walk_listing() lists a path or a
listed directory for the walk and for the tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 815718f)
- Make the callable of S3Executor.submit(), submit_to(), run() and
  run_shielded() positional-only, and the future of submit_to(), so that
  keyword arguments named fn, self or future reach the callable. The
  coroutines of AioS3FileSystem that forward their caller's keyword
  arguments into run() no longer raise TypeError for them, and the
  functools.partial bindings added to avoid the collision are dropped.
- Start no call of a map once an enclosing stop_retries_on() scope has
  been stopped; such a call's outcome is a CancelledError. Scopes that
  unstoppable_retries() clears do not stop it.
- Classify each failure of a map with the counts predicate once, instead
  of up to three times, and take no further item once a failure has
  stopped the batch. An error raised by iterating the items is raised as
  an interrupt of the waiting thread is.
- Document that a request submitted from a thread of the request pool
  runs in that thread outside the limit of its file or operation.

Backport (4.x), partial by decision on #1327 and #1533: the first item
(positional-only callables and future, and the removal of the
functools.partial bindings in AioS3FileSystem) is master only (5.0.0),
since it breaks callers that pass fn=, self= or future= by keyword. Left
out of this commit: the "/" in the signatures of S3Executor.submit(),
submit_to(), run(), run_shielded(), S3ThreadPool.submit() and
_S3PoolScope.submit(), the class docstring sentence on positional-only
arguments, every change to pyathena/filesystem/s3_async.py (all of them
drop partial bindings), and test_keyword_arguments_reach_callable. The
other three items are applied as on master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5b8b740)
…1472)

As in S3FileSystem, the annotation copies of a committed multipart copy
run in unstoppable_retries(), so that an enclosing stop scope, which now
keeps a map from starting its calls, does not leave the destination
without its annotations. The copy's own failure still stops the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 877e63a)
…H-1472)

Round-one review repairs:

- The stop of an enclosing stop scope aborts the map as an error of the
  counts predicate does: no further item is taken, and the map raises
  CancelledError once the running calls have ended, whatever
  stop_on_failure is. A map in a stopped scope therefore takes no item,
  and cat(on_error="omit"/"return") no longer turns the stop into ignored
  per-item errors.
- A CancelledError always counts and is not passed to counts.
- An error of counts stops the batch and is raised whichever thread
  classifies the failure, instead of becoming the outcome, the failure,
  or the raised error depending on that thread.
- The classified futures are kept by identity and not dropped by
  clear(), so a done callback that runs after the map has returned does
  not classify a failure again or keep its future.
- Share the rejecting test executor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 97ba132)
- Replace the separate abort error and the stop_on_failure check of the
  first failure with one error that the batch raises once it stops.
- Describe the done callback's except branch as it now works, and drop
  the internal serialization of counts from the map() docstring.
- Share the late-callback Future patch as _late_callbacks(), and reuse
  ImmediateExecutor for the inline executor of a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ee8d904)
Independent review repairs:

- The waiting thread checks the enclosing stop scopes every second and
  aborts the map, so that a map whose calls are queued behind those of
  other operations ends and cancels them.
- A failure is marked classified only once it is recorded, so that an
  interrupt before that leaves it to the next thread that sees it; an
  interrupt in counts is raised also after an earlier failure.
- The futures of a batch are not kept by a variable of the submitting
  frame, which an inline call's traceback keeps, and clear() drops the
  error to raise, whose traceback can refer to the batch.
- A batch operation of a single item, which runs in the calling thread,
  does not start once an enclosing stop scope has stopped and always
  raises a CancelledError, as a map does.
- Drop the garbage collection example of inline submissions from the
  docs; a finalizer in a pool thread closes its file in another thread.
- Tests: the predicate-error test checks that no further call runs, the
  late-callback helper fails if a callback does not end, the
  queued-cancellation test waits for the held call, and the keyword test
  covers the scope's submit().

Backport conflict (4.x): tests/pyathena/filesystem/test_s3_executor.py.
This commit extends test_keyword_arguments_reach_callable, which the 4.x
backport of 5b8b740 leaves out with the positional-only item (master
only). Resolved by leaving out that test's extension; the rest of the
commit is applied as on master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit e85c7f6)
Independent follow-up repairs:

- The waiting thread checks the enclosing stop scopes before each wait,
  so that a batch whose calls have all ended returns its outcomes, as it
  does when it has ended before the wait starts.
- An error of counts is recorded before its future is marked classified.
- Tests: the predicate-error test checks that a rejecting executor gets
  no further submission, and the queued-stop test covers map_async().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3dc44ea)
…1472)

- _watch_scopes() aborts only a batch that has not ended, so that calls
  that end between the loop check and the stop return their outcomes.
- The queued-stop test stops the scope once the map is waiting, so that
  it fails if the scopes are checked only when the wait starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit caaec0a)
- touch(truncate=False) looks the object up without the listing cache and
  sends PutObject with IfNoneMatch="*", translating the 412 into the
  documented ValueError, so that it never replaces an object that a stale
  cached listing or a concurrent writer hides.
- A multipart copy of a source without a version to pin (none, or "null")
  copies each part with CopySourceIfMatch on the ETag that HeadObject
  reported, unless the caller gives a CopySourceIf* condition, so that a
  source replaced during the copy fails it instead of completing with parts
  of two objects.
- When CopyObject rejects a source with InvalidRequest, cp_file (sync and
  aio) looks the source up again without the cache and copies it with a
  multipart upload if it has outgrown CopyObject since its size was cached.
- S3Core.call() rewinds the operation's streamed payload before a retry,
  such as the AnnotationPayload of PutObjectAnnotation, not only a Body.

Backport conflict (4.x): S3FileSystem.touch() in
pyathena/filesystem/s3.py. On master, d82b612 (#1435, master only) had
made touch() send PutObject through core.call() and return the raw
response; 4.x sends it with core.put_object() and returns
S3PutObject.to_dict(). Resolved with this commit's own delta only: the
4.x core.put_object() call is wrapped in the try/except that turns the
412 (FileExistsError) of IfNoneMatch="*" into the ValueError, and the 4.x
return value is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8e5d42e)
GH-1522)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 493a8a5)
- touch() rejects a bucket before any lookup, and invalidates the path when
  PutObject answers 412, which shows the object exists.
- A failed re-lookup after CopyObject's InvalidRequest raises CopyObject's
  error, not the lookup's.
- The ETag condition of the parts yields only to CopySourceIfMatch and
  CopySourceIfUnmodifiedSince, which it would override; CopySourceIfNoneMatch
  and CopySourceIfModifiedSince are sent with it.
- The annotations are read after the upload completes, not when the copy
  starts; the docs and docstring say so.
- S3Core shares one operation-model lookup between operation_params() and
  the streamed payload, and its docstrings name the payload.
- The live touch() check that could not fail is removed; test_exclusive_create
  already sends IfNoneMatch to S3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d27caa9)
- touch() names its error message once and invalidates the path in finally,
  after a success or any failure of the PutObject it sent.
- cp_file computes the source lookup parameters once and passes them to
  _copy_source_outgrown().
- plan_multipart_copy() collects the given parameter names once for the
  SSE-C and the condition checks, and states the condition rule in one place.
- S3Core reads the streamed payload member directly, which botocore always
  sets for an operation with streaming input.
- The docs state when the tags and the annotations are read in one sentence.
- Tests drop a redundant parameter and a conditional assertion.

Backport conflict (4.x): S3FileSystem.touch() in
pyathena/filesystem/s3.py, for the same cause as the backport of
8e5d42e: 4.x sends PutObject with core.put_object() and returns
S3PutObject.to_dict(), where master (d82b612, #1435, master only)
returns the raw response of core.call(). Resolved with this commit's own
delta only: the shared "exists" message, the invalidation in finally
(also after the 412), and the return from inside the try, which on 4.x
returns core.put_object(...).to_dict().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 0a0406a)
…on (GH-1522)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 9b726de)
…-1522)

- touch(truncate=False) decides with one HeadObject of the key as written,
  for every key, so a missing key no longer costs a ListObjectsV2; the
  temporary refresh flag of _object_exists() goes away.
- The re-lookup after CopyObject's InvalidRequest addresses the parsed
  source, so a key that ends in a slash is not looked up without it, and
  any failure of that lookup, not only an OSError, raises CopyObject's error.
- The docs and the plan docstring limit the abort to a part copy that finds
  the source replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 21876ee)
…quests in tests (GH-1522)

- _key_exists() looks the key up with _head_object(refresh=True), so the
  HeadObject that finds an object replaces the stale cached answer, and one
  that finds none evicts it.
- The tests assert the whole request sequence of a missing key (HeadObject,
  then PutObject) and that exists() sees an object the lookup found.
- The part_params docstring says that the core adds its request_kwargs,
  including their conditions, when it sends each request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 05727d2)
…tion docstring (GH-1522)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit fb9c457)
- An abort answered with NoSuchUpload discards the write instead of
  leaving it ABORT_FAILED, so a later abort sends nothing.
- A creation that waited behind other requests checks the stop scopes
  before it is sent, as the part requests do.
- An abort() call records its thread; a later call takes over an abort
  whose call ended without recording its outcome, as a second interrupt
  can make it, instead of waiting for it forever.
- An interrupt while the abort waits for a running creation no longer
  disappears: it is raised once the abort has ended.
- The part planner keeps a merged tail of the maximum part size as one
  part, as S3Core.part_ranges() does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 17680f6)
)

Self-review round one:
- A failed abort raises its failure again, not the deferred interrupt, so
  that S3File and the sync copy keep logging it with the upload ID; the
  operation still stops with an error.
- A call in another thread takes the abort over from a call in the main
  thread, which interrupts may have ended, such as a close handed over by
  a garbage collection; a single write is not used by two threads at once.
- The copy's docstring and the guide describe the deferred interrupt and
  what a NoSuchUpload abort leaves after a completion that took effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 987cce4)
Self-review round two: the async files and copies use one write from the
event loop and pool threads, so the take-over rule rests on the callers
not aborting one write from two threads at once, and on the async
aborts running in pool threads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 187e5cb)
…borts (GH-1526)

Independent review:
- The abort records its outcome in _end_abort() under a with statement
  of the lock itself, not _update(): an interrupt as _update()'s
  generator hands over the lock left the lock held by the suspended
  generator while the interrupt's traceback lived, and a retry in this
  thread waited for it forever.
- A call in another thread returns without waiting for an abort that the
  main thread owns, instead of taking it over: a close that a garbage
  collection hands over could otherwise send a second abort while the
  main thread's abort runs.
- The wait for a running creation checks whether it is done inside the
  interrupt handler, so that an interrupt as the check returns does not
  end the wait.
- The queued-creation test waits for the creation with a bound, and the
  GH-1077 test no longer pins the context of the raised interrupt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5cc7888)
Independent review follow-up: abort() cancels queued requests, whose done
callbacks then run in its thread and changed the session through the
_update() generator context manager. An interrupt as that generator
handed over the lock left the lock held by the suspended generator, and
the abort's own outcome then waited for it forever. Every change now
takes the lock with a with statement of the lock itself, which CPython
releases whatever interrupts it, and notifies the waits through
_publish() before releasing it.

Tests: the creation-wait test also interrupts the check for completion;
the main-thread scenario of the two-interrupt test runs bounded, with
its runner thread as the main thread; the test that modelled the
generator's window is removed with the generator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b5ebd9a)
Independent review follow-up 2:
- withdraw_complete() notifies the waits also when there is nothing to
  withdraw, as before, so that a call retried after an interrupt kept the
  first from notifying resolves the waiters.
- The another-thread scenario of the two-interrupt test runs in a forked
  child, whose main thread is the forking one, instead of patching
  threading.main_thread in a bounded thread, which leaked the patch when
  the bound expired.
- The creation-wait test releases the creation only when the wait goes on
  after the interrupt, so that a wait that ends early fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5a50b9b)
Independent review follow-up 3: the same-thread cases also run in the
main thread of a forked child, which interrupts reach and which is killed
on a deadlock, instead of a daemon thread that a deadlock would leave
holding sys.monitoring; the creation-wait abort runs bounded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b5d2549)
…ject copies (GH-1527)

- The response models keep the fields that botocore returns: HeadObject's
  ExpiresString, Restore, ArchiveStatus, PartsCount and the rest, PutObject's
  Size, DeleteObject's RequestCharged, the Owner and RestoreStatus of
  listed objects (new S3RestoreStatus), RestoreStatus of versions, the
  BucketArn of buckets and HeadBucket's location fields
  (S3Bucket.from_head_response), the CommonPrefixes of upload listings, and
  the delete marker fields of DeleteObjects (new S3DeletedObject in
  S3DeleteResult.deleted_objects). New fields default to None, so that the
  constructors and earlier pickles stay compatible.
- list_multipart_uploads() follows NextKeyMarker alone, as directory
  buckets page; listings with an explicit EncodingType="url" send the next
  key marker decoded.
- The filesystem requests the enclosing "/"-terminated prefix for the
  uploads of a key in a directory bucket, and invalidates the listings
  above an upload in a directory bucket once its abort has been sent
  (clear_multipart_uploads(), S3File.discard(), the async file's discard).
- S3Object: copy.copy() copies the metadata mapping, S3Object() and
  fromkeys() work, to_api_repr() returns a copy of the metadata.
- repr() of S3MultipartCopyPlan and S3FileTarget leaves out the request
  parameters and the buffered append data.
- Docs: S3Owner, the new models, S3DeleteBatch under requests, unparseable
  Expires values, and corrected docstrings.

Backport conflict (4.x): TestS3PutObject.test_to_dict in
tests/pyathena/filesystem/test_s3_object.py. On master, d82b612 (#1435,
master only) had keyed to_dict() by the field names; on 4.x it keys them
with a leading underscore. Resolved with this commit's own delta only:
the 4.x assertion also expects the key of the new size field, "_size".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 123968c)
)

Self-review round one:
- The files also invalidate the listings above their upload in a
  directory bucket once its creation has succeeded, as #1527 asks for
  creation and abort.
- list_multipart_uploads() sends the next key marker as given: a
  directory bucket obfuscates it, so decoding it could corrupt it; only
  list_object_versions() decodes it, inline.
- clear_multipart_uploads() checks the directory bucket once and
  invalidates each key once.
- copy.copy() of an S3Object dispatches to copy() of its class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 72a323b)
Self-review round two: botocore returns ExpiresString with any Expires
header and removes Expires only when it cannot parse it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 26ff04e)
…1527)

Independent review:
- list_object_versions() also decodes the key marker when the core's
  request_kwargs give EncodingType="url".
- S3DeleteResult derives deleted or deleted_objects from the other when
  only one is given, so that a result built from paths equals the result
  of a response without delete marker fields.
- The listing pages and the result of DeleteObjects keep RequestCharged;
  the shape test compares their top-level shapes, omitting the echoes of
  their requests, and the value-level checksum test is restored.
- A committed write keeps the listings when it is discarded; the prefix
  of a directory-bucket key that starts with "/" is "/".
- Tests: the async file's creation and abort invalidation, ListBuckets'
  BucketArn, the core-level EncodingType, and the keys of fromkeys().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2f0f1ce)
Independent review follow-up:
- S3DeleteResult no longer derives deleted or deleted_objects from the
  other, which pickles of earlier versions skipped and which
  dataclasses.replace() undid; deleted_objects and request_charged take
  no part in its equality, as request_charged of the listing pages, so
  that results and pages compare as before the fields.
- Only a discard whose abort may send a request invalidates the listings,
  not one of a committed or already discarded write.
- Tests: RequestCharged values of the pages and the delete result, a
  repeated discard, and a bounded close in the async test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 85b9d30)
…-1527)

Independent review follow-up 2: a discard invalidates the listings unless
the write was already discarded or ends committed, judged after the abort,
so that a discard that waited for a failing commit and then aborted
invalidates them. Tests: the delete marker version ID directly, page
equality and hashing with RequestCharged, dataclasses.replace() of a
delete result, and bounded repeated and async scenarios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 62c05df)
Independent review follow-up 3: the sync scenario runs in call_bounded,
so that a regression that blocks any of its discards fails the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8f926dc)
Comment thread pyathena/filesystem/s3.py
self.invalidate_cache(path)
return object_.to_dict()
try:
return self.core.put_object(s3_path, None, **kwargs).to_dict()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review round 1 (implementation behavior): CLEAN

Scope: git diff 6b4dd57a6685b5da061e1b95557deea55489ee0d..0afe623b69b39ce824fde144c3c8a3fcb8022800 (merge base = #1553's head; 31 commits, cherry-picks of #1540 c1+c3, #1533, #1535, #1537, #1545).

Covered:

Findings: none.
Limits: the #1533 commits have no differential harness; their regression tests are ported with them and pass. Live AWS tests not run (CI on Ready).

Comment thread pyathena/filesystem/s3.py
self.invalidate_cache(path)
return object_.to_dict()
try:
return self.core.put_object(s3_path, None, **kwargs).to_dict()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review round 2 (claims, callers, operations): FINDINGS → repaired in the PR body

Scope: the same 6b4dd57a6685b5da061e1b95557deea55489ee0d..0afe623b69b39ce824fde144c3c8a3fcb8022800, the PR body, the conflict notes in the commit messages, and the docs the commits change.

Claims checked:

Existing callers on 4.x: S3DeleteBatch stays importable from s3_core (old pickles load). The new model fields default to None (#1545's pickle tests pass). touch(truncate=False) now always sends a HeadObject, and PutObject carries If-None-Match: * (release-noted as on master).
Docs: docs/filesystem.md/docs/aio.md say nothing about touch() that the 4.x return value contradicts.
Evidence: the test counts and differential checks in round 1 ran on this head.

Limits: the ported regression tests were not rerun against 4.x with their fixes reverted (master's PRs recorded those mutation checks). The differential checks above are the 4.x-side evidence that each fix changes the expected cases.

Comment thread pyathena/filesystem/s3.py
self.invalidate_cache(path)
return object_.to_dict()
try:
return self.core.put_object(s3_path, None, **kwargs).to_dict()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review (relayed): Codex CLI 0.172.0, model gpt-6.2-astra, reasoning effort max, codex exec -s read-only, session 01a2280d-3fb6-7f21-a864-c013d1a3a8fc. Static review only (no builds or tests).

Scope: 6b4dd57a6685b5da061e1b95557deea55489ee0d..0afe623b69b39ce824fde144c3c8a3fcb8022800, in a detached snapshot of the head (unchanged afterwards). The prompt gave the master merge SHAs, the master-only commits and the 4.x contracts to keep (connection=/s3_filesystem, touch() → S3PutObject.to_dict(), underscore keys), with no PR number, description or author conclusions.

Reviewer coverage: all 31 cherry-picks in order ("Twenty-six have identical added and removed lines. The other five differ only for the requested executor omission, the 4.x touch() return path, or the _size assertion"); du()/walk() without 19633ee; executor stop scopes, failure accounting and annotation copies ("compatible with the retained keyword-callable signatures and functools.partial bindings"); conditional touch(), copy conditions, payload rewind, write-session abort and creation, part sizing; response fields, directory-bucket uploads, S3Object copies; tests against "Choose what to test" and the AWS fixtures ("All seven filesystem tests unique to the 4.x base remain present").

Result: CLEAN.

Base automatically changed from backport/4.x-1489-1534 to 4.x November 30, 2026 02:01
Comment thread pyathena/filesystem/s3.py
self.invalidate_cache(path)
return object_.to_dict()
try:
return self.core.put_object(s3_path, None, **kwargs).to_dict()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branch update after #1553 merged: review scope unchanged

gh pr update-branch merged 4.x (dc7f81a, the merge of #1553) into this branch: head 0afe623 → 37cd1b3. The tree of dc7f81a equals that of 6b4dd57 (the base reviewed before), and the tree of the new head equals that of 0afe623 (git rev-parse <sha>^{tree}), so git diff dc7f81ac..37cd1b35 is the reviewed diff. The two self-review rounds and the independent review above apply to it unchanged.

@laughingman7743
laughingman7743 marked this pull request as ready for review November 30, 2026 02:12
@laughingman7743
laughingman7743 merged commit ca4f178 into 4.x Nov 30, 2026
14 checks passed
@laughingman7743
laughingman7743 deleted the backport/4.x-1540-1545 branch November 30, 2026 07:38
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