Merged
Conversation
…or missing mssql_py_core
Contributor
There was a problem hiding this comment.
Pull request overview
This PR promotes the cursor bulk copy helper from a private method (_bulkcopy) to a public API (bulkcopy), aligning the test suite with the new method name and adjusting the runtime error messaging when the native mssql_py_core dependency is unavailable.
Changes:
- Renamed
Cursor._bulkcopy(...)toCursor.bulkcopy(...)to expose bulk copy as a public API. - Updated the bulkcopy integration test to call
cursor.bulkcopy(...). - Updated the ImportError message shown when
mssql_py_corecannot be imported.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_019_bulkcopy.py | Updates test to use the new public cursor.bulkcopy() API. |
| mssql_python/cursor.py | Renames the method to bulkcopy() and changes the ImportError message for missing/unloadable mssql_py_core. |
Comments suppressed due to low confidence (1)
mssql_python/cursor.py:2515
bulkcopyis now part of the public Cursor API, but it’s still excluded from coverage via# pragma: no cover. Since there’s an integration test module for bulkcopy, consider removing the pragma (or narrowing the exclusion to only the truly untestable branches) so coverage will catch regressions in this public method.
def bulkcopy(
self,
table_name: str,
data: Iterable[Union[Tuple, List]],
batch_size: int = 0,
timeout: int = 30,
column_mappings: Optional[Union[List[str], List[Tuple[int, str]]]] = None,
keep_identity: bool = False,
check_constraints: bool = False,
table_lock: bool = False,
keep_nulls: bool = False,
fire_triggers: bool = False,
use_internal_transaction: bool = False,
): # pragma: no cover
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.hpp: 58.8%
mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.row.py: 66.2%
mssql_python.pybind.ddbc_bindings.cpp: 69.4%
mssql_python.pybind.ddbc_bindings.h: 69.7%
mssql_python.pybind.connection.connection.cpp: 75.3%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 79.6%
mssql_python.cursor.py: 84.7%
mssql_python.__init__.py: 84.9%🔗 Quick Links
|
Theekshna
approved these changes
Feb 25, 2026
subrata-ms
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…or missing mssql_py_core
Work Item / Issue Reference
Summary
This change renames
_bulkcopytobulkcopyto make the feature available in the public API surface area.