Skip to content

Commit

Permalink
Merge pull request #6562 from PrimozGodec/test-pymssql
Browse files Browse the repository at this point in the history
[CI] Test with pymssql
  • Loading branch information
lanzagar committed Sep 8, 2023
2 parents e09f1b2 + 99cdb58 commit 24596fe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Orange/widgets/data/tests/test_owtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ def setUpDB(self):
# pylint: disable=attribute-defined-outside-init
conn, iris = self.create_iris_sql_table()
data = SqlTable(conn, iris, inspect_values=True)
if self.current_db == "mssql":
# when loading data from mssql db, Sql widget returns Table (not SqlTable)
data = Table(data)
self.data = data.transform(Domain(data.domain.attributes[:-1],
data.domain.attributes[-1]))

Expand Down
3 changes: 3 additions & 0 deletions Orange/widgets/obsolete/tests/test_owtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ def setUpDB(self):
# pylint: disable=attribute-defined-outside-init
conn, iris = self.create_iris_sql_table()
data = SqlTable(conn, iris, inspect_values=True)
if self.current_db == "mssql":
# when loading data from mssql db, Sql widget returns Table (not SqlTable)
data = Table(data)
self.data = data.transform(Domain(data.domain.attributes[:-1],
data.domain.attributes[-1]))

Expand Down
7 changes: 5 additions & 2 deletions Orange/widgets/utils/tests/test_itemmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,11 @@ def tearDownDB(self):
@dbt.run_on(["postgres", "mssql"])
def test_dense_data(self):
table = SqlTable(self.conn, self.iris, inspect_values=True)
table.domain = Domain(table.domain.attributes[:-1],
table.domain.attributes[-1])
if self.current_db == "mssql":
# when loading data from mssql db, Sql widget returns Table (not SqlTable)
table = Table(table)
new_domain = Domain(table.domain.attributes[:-1], table.domain.attributes[-1])
table = table.transform(new_domain)
model = TableModel(table)

self._dense_data(table, model.data, model.index)
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ deps =
-r {toxinidir}/requirements-opt.txt
coverage
psycopg2-binary
# no wheels for mac
pymssql<3.0;platform_system!='Darwin' and python_version<'3.8'
pymssql<3.0
latest: https://github.com/pyqtgraph/pyqtgraph/archive/refs/heads/master.zip#egg=pyqtgraph
latest: https://github.com/biolab/orange-canvas-core/archive/refs/heads/master.zip#egg=orange-canvas-core
latest: https://github.com/biolab/orange-widget-base/archive/refs/heads/master.zip#egg=orange-widget-base
Expand Down

0 comments on commit 24596fe

Please sign in to comment.