Skip to content

Change pymssql -> pyODBC#58

Merged
JonathanZhu11 merged 22 commits intomasterfrom
JonathanZhu11/pyODBC
Mar 24, 2020
Merged

Change pymssql -> pyODBC#58
JonathanZhu11 merged 22 commits intomasterfrom
JonathanZhu11/pyODBC

Conversation

@JonathanZhu11
Copy link
Copy Markdown
Contributor

Support of pymssql officially stopped in November 2019 in favor of pyODBC. This change updates sqlmlutils to use pyODBC instead, and changes the version from 0.7.2 -> 0.8.0.

This change brings a few other changes as well:

  1. pymssql allows us to capture the informational messages that come from SQL Server, but pyODBC does not (see here). This means that any output from sp_execute_external_script cannot be captured in a convenient way when using pyODBC. Instead, we capture the output inside python and send it to the caller using output parameters.

  2. pyODBC allows us to easily implement output parameters, and since we need them for the above stdout problem, we have added them here. As part of this change, stored procedure execution now return a tuple of type (DataFrame, dictionary) where the first element is the OutputDataSet and the second is a dictionary of output parameters.

  3. pyODBC allows us to parameterize the sql queries instead of using concatenated strings. This also allows us to transfer larger binaries, which is useful for package management.

  4. Some code refactoring, including using f-strings for code reading ease instead of .format in a number of places.

  5. Export Scope as well so the user doesn't have to dig for the correct module to find Scope for package management.

  6. Changed a number of tests that were using old package versions so that they are up to date, and to speed up testing.

@JonathanZhu11 JonathanZhu11 requested review from a team, ivannp, mmn599 and rajmera3 March 3, 2020 19:31
@JonathanZhu11 JonathanZhu11 removed the request for review from rajmera3 March 13, 2020 23:08
@JonathanZhu11 JonathanZhu11 merged commit dade183 into master Mar 24, 2020
@JonathanZhu11 JonathanZhu11 deleted the JonathanZhu11/pyODBC branch March 15, 2021 22:26
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.

3 participants