Skip to content

REFACTOR: Mark preview async entry-point classes as internal - #811

Merged
Subrata (subrata-ms) merged 2 commits into
mainfrom
subrata-ms/AQEPreview
Sep 24, 2026
Merged

Subrata (subrata-ms) merged 2 commits into
mainfrom
subrata-ms/AQEPreview

Conversation

@subrata-ms

@subrata-ms Subrata (subrata-ms) commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Work Item / Issue Reference

AB#48345

GitHub Issue: #<ISSUE_NUMBER>


Summary

This pull request makes the async query API's entry points explicitly internal by renaming AsyncConnection and AsyncCursor to _AsyncConnection and _AsyncCursor throughout the codebase. These classes are no longer part of the public API, and all references, imports, and type hints have been updated accordingly. The tests and documentation have also been updated to reflect these changes, ensuring that users cannot accidentally rely on unstable async APIs.

Async API Internalization:

  • Renamed AsyncConnection and AsyncCursor to _AsyncConnection and _AsyncCursor in all source files, marking them as internal and updating all references, imports, and type hints to use the new names. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]

  • Removed AsyncConnection and AsyncCursor from the __all__ export list in mssql_python.async_query, ensuring they are not part of the public API surface.

Test and Documentation Updates:

  • Updated all tests to use _AsyncConnection and _AsyncCursor, and added a test to verify that the public API does not expose the async entry points. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

  • Updated module docstrings and comments to clarify that _AsyncConnection and _AsyncCursor are internal and not stable public APIs.

These changes reinforce that async query support is experimental and not intended for public consumption, preventing accidental usage and clarifying the intended API boundaries.

Copilot AI lite review requested due to automatic review settings September 24, 2026 04:37
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

PR Performance Report

Performance assessment superseded.

The pull request revision changed before publication completed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Update connection and cursor documentation that still describes these internal APIs as public.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)
What changed in this PR

Refactors preview async connection and cursor entry points into internal APIs.

Changes:

  • Renames async wrapper classes with underscore-prefixed names.
  • Updates references, fixtures, and async tests.
  • Removes public exports and adds export-boundary coverage.
File Reviewed change
tests/​AsyncTest/​test_007_async_fetch.py Updates fetch tests for internal APIs.
tests/​AsyncTest/​test_006_async_execute.py Updates execution tests.
tests/​AsyncTest/​test_004_async_logging.py Updates logging tests.
tests/​AsyncTest/​test_003_async_exceptions.py Updates exception tests.
tests/​AsyncTest/​test_002_async_connection.py Updates connection tests.
tests/​AsyncTest/​test_001_async_query_native.py Verifies internal naming and exports.
tests/​AsyncTest/​conftest.py Updates the async connection fixture.
mssql_python/​async_query/​async_fetch.py Updates cursor type references.
mssql_python/​async_query/​async_execute.py Updates cursor type references.
mssql_python/​async_query/​async_cursor.py Renames the cursor wrapper.
mssql_python/​async_query/​async_connection.py Renames the connection wrapper.
mssql_python/​async_query/​__init__.py Updates internal exports.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread mssql_python/async_query/async_connection.py
Comment thread mssql_python/async_query/async_cursor.py
Co-authored-by: subrata-ms <141804867+subrata-ms@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Update async connection documentation that still describes the internal entry points as public.

Review effort: Lite
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

@github-actions

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

84%


📈 Total Lines Covered: 9056 out of 10697
📁 Project: mssql-python


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

  • mssql_python/async_query/init.py (100%)
  • mssql_python/async_query/async_connection.py (100%)
  • mssql_python/async_query/async_cursor.py (100%)
  • mssql_python/async_query/async_execute.py (100%)
  • mssql_python/async_query/async_fetch.py (100%)

Summary

  • Total: 15 lines
  • Missing: 0 lines
  • Coverage: 100%

📋 Files Needing Attention

📉 Files with overall lowest coverage (click to expand)
mssql_python.pybind.performance_counter.hpp: 0.7%
mssql_python.pybind.logger_bridge.cpp: 57.9%
mssql_python.pybind.ddbc_bindings.h: 64.1%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 78.4%
mssql_python.pybind.connection.connection.cpp: 82.5%
mssql_python.pybind.connection.connection_pool.cpp: 82.9%
mssql_python.logging.py: 86.2%
mssql_python.pooling.py: 90.1%
mssql_python.pybind.fetch_temporal.hpp: 92.1%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

@subrata-ms
Subrata (subrata-ms) merged commit a8d2523 into main Sep 24, 2026
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: medium Moderate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants