You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
S3TablesCatalog.has_table returns False on AccessDenied and other non-404 errors #7709
S3TablesCatalog.has_table returns False for any failure, not just a missing table. An AccessDenied, a throttling error or a network failure therefore looks the same as "this table does not exist", and code that does if not catalog.has_table(t): catalog.create_table(t, ...) goes on to act on a wrong answer.
_get_table already separates the two cases: it turns NotFoundException into NotFoundError and re-raises every other ClientError. _has_namespace, just above in the same file, returns False only for NotFoundException and re-raises the rest, so the two methods behave differently.
Proposed fix
Catch only NotFoundError in _has_table, so other errors reach the caller as they already do from _has_namespace and get_table. Add tests in tests/catalog/test_s3tables.py with a mocked client: NotFoundException gives False, AccessDeniedException raises.
This changes behavior (callers that today get False on a permissions error would get an exception), so per CONTRIBUTING I'm asking first. If you're fine with it, I'll open the PR.
Disclosure: this issue was drafted with the help of an AI assistant (Claude); the code reading was done by it and has not been run against a live S3 Tables bucket.
Activity