mengw15 opened a new pull request, #5092:
URL: https://github.com/apache/texera/pull/5092

   ### What changes were proposed in this PR?
   
   `IcebergIterator._seek_to_usable_file` previously swallowed every error 
during file-scan setup:
   
   ```python
   except Exception:
       print("Could not read iceberg table:\n")
       raise Exception
   ```
   
   The bare `raise Exception` (no args, no `from`) constructs a fresh 
`Exception` with empty `str()` and no `__cause__`. Callers that do `except 
Exception as e: log.error(str(e))` see only an empty class name — the original 
error type, message, and traceback are all lost. The `print` also bypasses the 
project logger.
   
   This PR replaces the bare re-raise with a true re-raise of the original 
exception and routes the diagnostic message through `loguru`:
   
   ```python
   except Exception:
       logger.exception("Could not read iceberg table")
       raise
   ```
   
   Callers now see the actual underlying exception (catalog auth failure, S3 IO 
error, manifest corruption, etc.) with its full class name, message, and 
traceback.
   
   ### Any related issues, documentation, discussions?
   
   Closes #5091.
   
   ### How was this PR tested?
   
   Added 
`amber/src/test/python/core/storage/iceberg/test_iceberg_iterator_error_paths.py`,
 which mocks `load_table_metadata` to return a table whose `refresh()` raises 
`RuntimeError("Catalog auth failure: token expired")`, drives 
`next(IcebergIterator(...))`, and asserts the original message is visible in 
the surfaced exception (or that `__cause__` is chained — stable across either 
fix shape).
   
   Run locally:
   
   ```
   python -m pytest 
amber/src/test/python/core/storage/iceberg/test_iceberg_iterator_error_paths.py 
-v
   ```
   
   Result: `1 passed`. Nearby `test_document_factory.py` also remained green (7 
passed), confirming no import-level regression.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (claude-opus-4-7)
   
   ---
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to