Skip to content

Conversation

dingo4dev
Copy link
Contributor

Part of #2399

Rationale for this change

This PR introducs the implementation of close() method to the RestCatalog.

And add corresponding test case which following the test pattern in #2390

Are these changes tested?

Yes

Are there any user-facing changes?

@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 05:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a close() method to the RestCatalog class to properly close the HTTP session and release connection adapters. This implements proper resource cleanup for the REST catalog.

  • Added the close() method implementation that calls self._session.close()
  • Added comprehensive test coverage for the close functionality
  • Included tests for both regular and SigV4-enabled catalog configurations
  • Added context manager exception handling tests

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pyiceberg/catalog/rest/init.py Added the close() method implementation to RestCatalog class
tests/catalog/test_rest.py Added comprehensive test suite for the new close functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

LGTM!

@kevinjqliu kevinjqliu merged commit 86b0fe8 into apache:main Aug 29, 2025
10 checks passed
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.

2 participants