Skip to content

Commit

Permalink
additional test for umlauts
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Dec 30, 2021
1 parent e4cecee commit 1050372
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix: There had been an issue, there the correct binary size for the longest possible text has been underestimated on Linux then querying a column with UTF-16 encoded characters.
- Fix: There had been an issue, there the correct binary size for the longest possible text has been underestimated on Windown then querying a column with UTF-8 encoded characters.

## 0.1.10

- Allow specifying user and password seperatly from the connection string.
Expand Down
18 changes: 18 additions & 0 deletions tests/test_arrow_odbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,24 @@ def test_query_wchar():
assert expected == actual


def test_query_umlaut():
"""
Query a string those UTF-8 representation is larger in bytes than in
characters.
"""
query = "SELECT CAST('Ü' AS VARCHAR(1)) as a"
reader = read_arrow_batches_from_odbc(
query=query, batch_size=100, connection_string=MSSQL
)

it = iter(reader)
batch = next(it)
actual = batch.to_pydict()
expected = {"a": ["Ü"]}

assert expected == actual


def test_iris():
"""
Validate usage works like in the readme
Expand Down

0 comments on commit 1050372

Please sign in to comment.