Skip to content

Commit 20c6a85

Browse files
committed
Fixes for tests on nasty data, which were add to base test class
1 parent 52e65b7 commit 20c6a85

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

orangecontrib/geo/widgets/owgeocoding.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ def guess_region_type(self):
229229
def commit(self):
230230
output = None
231231
if self.data is not None and len(self.data):
232-
data, metas = self.decode() if self.is_decoding else self.encode()
233-
if data is not None:
232+
res = self.decode() if self.is_decoding else self.encode()
233+
if res is not None and res[0] is not None:
234+
data, metas = res
234235
output = self.data.transform(
235236
Domain(self.data.domain.attributes,
236237
self.data.domain.class_vars,

orangecontrib/geo/widgets/owgeotransform.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ def __init__(self):
115115

116116
def init_attr_values(self):
117117
self.Error.no_lat_lon_vars.clear()
118-
self.variable_model.set_domain(self.data.domain if self.data else None)
118+
self.variable_model.set_domain(
119+
self.data.domain if self.data is not None else None)
119120

120121
lat, lon = None, None
121-
if self.data:
122+
if self.data is not None:
122123
lat, lon = find_lat_lon(self.data, filter_hidden=True)
123124
if not (lat and lon):
124125
self.Error.no_lat_lon_vars()
@@ -135,7 +136,7 @@ def set_data(self, data: Table = None):
135136
self.apply()
136137

137138
def apply(self):
138-
if not self.data:
139+
if not self.data or self.attr_lat is None or self.attr_lon is None:
139140
self.Outputs.data.send(None)
140141
self.report_data = None
141142
return

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ setenv =
2222
deps =
2323
{env:PYQT_PYPI_NAME:PyQt5}=={env:PYQT_PYPI_VERSION:5.15.*}
2424
{env:WEBENGINE_PYPI_NAME:PyQtWebEngine}=={env:WEBENGINE_PYPI_VERSION:5.15.*}
25+
oldest: numpy~=1.24.0
2526
oldest: numpy~=1.22.0 # some older version
2627
oldest: orange3==3.37.0
2728
oldest: orange-canvas-core>=0.2.2,
2829
oldest: orange-widget-base>=4.23.0,
29-
oldest: pandas==1.4.0
30+
oldest: pandas<2.1
3031
oldest: scikit-learn~=1.3.0
3132
latest: https://github.com/biolab/orange3/archive/refs/heads/master.zip#egg=orange3
3233
latest: https://github.com/biolab/orange-canvas-core/archive/refs/heads/master.zip#egg=orange-canvas-core

0 commit comments

Comments
 (0)