All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
DatabaseResult.to_dataframe
does not take *args anymore (this would have thrown an error anyway).DatabaseResult.to_dataframe
now throws a ValueError if data is passed as a kwarg.
- Fixed type hints (and added missing type hints). This library now passes mypy strict check.
- Added a
py.typed
file so that mypy etc will treat this library as being typed.
DatabaseResult.to_dataframe()
will now return an empty dataframe with the correct column names if the result has column information but no rows. Warning: Pandas will not be able to infer the correct dtypes from these columns.- Loosened version restrictions on
Pandas
andORJSON
dependencies to be any version number.
- Added support for multiple result sets, you can move between result sets using the new
next_set()
andprevious_set()
methods onDatabaseResult
.DatabaseResult
class also has a new attributeset_count
to tell you how many result sets the query returned. DatabaseResult.to_json()
now has an optionalwith_columns
parameter.- Added some missing doc strings.
- Added some more tests, coverage now at 92%.
- BREAKING: DatabaseResult's
source_types
,columns
,raw_data
anddata
, attributes/properties now cannot beNone
, in order to decrease type ambiguity. To facilitate this change, they will raise a ValueError if they are called when the DatabaseResult instance errored, or fetch was false. - The SQLParameter type hint (used in various places) is now just an alias for Any.
- Miscellaneous refactoring and type hinting/guarding throughout the library. The
library now passes a basic
pyright
check with no errors.
- Handle specific length byte strings raising exceptions when parsing database result, closes #15.
- SQL Type
Uniqueidentifier
is now handled correctly and returned as a string, closes #13.
- Fixed incorrect type hint for
DatabaseResult.data
.
- Data parsing now raises warning when handling an unrecognised type and returns identity function mapping instead of raising an Exception.
- This package now requires "pymssql>=2.1.4" instead of "pymssql>=2". This was implicit anyway as 2.1.4 is the minimum version that supports Python 3.7.
- Added a TDS Protocol version warning for users using version 7.2 or below, this is only checked once.
- Added some more type hints to
DatabaseResult
.
- Fix an issue where the returned result would be limited to 10,000 rows, #11.
- Relaxed Python version syntax (effectively the same versions, just a less explicit description).
- Dropped support for Python 3.6, this might still work, but it is not guaranteed or tested.
- Improved intended type inference using
Cursor.description
information. - Optimized performance by only checking the first non-null item in a column.
- Optimized memory usage by fetching and cleaning results in batches of 10k.
- Moved project and pipelines to use Poetry.
- Use flake8, isort and black for linting.
- Removed unnecessary dateutil dependency.
- Fixed an edge case where strings with a mix of non-datelike and datelike formats would be parsed as mixed data types instead of just string.