Skip to content

#155 sync close()/context manager - #160

Merged
martinkersner merged 1 commit into
mainfrom
worktree-agent-a93505ae3a21ba5ee
Jul 4, 2026
Merged

#155 sync close()/context manager#160
martinkersner merged 1 commit into
mainfrom
worktree-agent-a93505ae3a21ba5ee

Conversation

@martinkersner

Copy link
Copy Markdown
Member

Closes #155

Summary

Sync client lacked close()/context-manager support and leaked its requests.Session. Added close()/__enter__/__exit__ to API, delegated through Datamaxi (self._api.close()) — mirroring the async aclose/__aenter__/__aexit__ pattern. Enables with Datamaxi(...) as client:.

Tests

  • Added tests for API.close(), with API(), and with Datamaxi(...) closing the session.
  • 175 passed, 11 skipped. black + flake8 clean.

mirrors AsyncAPI/AsyncDatamaxi aclose/__aenter__/__aexit__
@martinkersner
martinkersner marked this pull request as ready for review July 4, 2026 11:37
@martinkersner
martinkersner merged commit 9552fcd into main Jul 4, 2026
5 checks passed
@martinkersner
martinkersner deleted the worktree-agent-a93505ae3a21ba5ee branch July 4, 2026 11:37
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.

Sync client lacks close()/context manager; requests.Session leaks

1 participant