Skip to content

Commit 2500f06

Browse files
Merge pull request #70 from vpriyankaprabhu/master
Release 3.1.10
2 parents f611192 + 6b2282c commit 2500f06

4 files changed

Lines changed: 32 additions & 24 deletions

File tree

ibmpairs/query.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6695,8 +6695,16 @@ async def async_submit(self,
66956695
logger.error(msg)
66966696
raise common.PAWException(msg)
66976697
else:
6698+
csv = False
6699+
if compact_csv or (
6700+
self._output_type and self._output_type.lower() == 'csv'
6701+
and self._spatial and self._spatial.type
6702+
and self._spatial.type.lower() in ['point']
6703+
):
6704+
csv = True
6705+
66986706
query_response = query_response_from_json(response.body,
6699-
compact_csv = compact_csv)
6707+
compact_csv = csv)
67006708

67016709
query.submit_response = query_response
67026710

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from setuptools import setup
33

44
# define package version
5-
version = '3.1.9'
5+
version = '3.1.10'
66
# ... and record it for ibmpairs package
77
with open("ibmpairs/version.py", 'w') as f:
88
f.write('# generated by setup.py\nversion = "{}"\n'.format(version))

tests/test_catalog.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ def test_data_set_get(self, mock_get):
21102110
result = ds3.get(id = "3")
21112111
except Exception as ex:
21122112
got_exception3 = True
2113-
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_set_requests_get.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
2113+
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
21142114

21152115
self.assertTrue(got_exception3)
21162116

@@ -2190,7 +2190,7 @@ def test_data_set_create(self, mock_post):
21902190
data_set_create3.create()
21912191
except Exception as ex:
21922192
self.logger.info(ex)
2193-
self.assertEqual(str(ex), "The POST request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/ encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_set_requests_post.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
2193+
self.assertEqual(str(ex), "The POST request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/ encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
21942194
got_exception3 = True
21952195

21962196
self.assertTrue(got_exception3)
@@ -2273,7 +2273,7 @@ def test_data_set_update(self, mock_put):
22732273
data_set_update3.update(id = 3)
22742274
except Exception as ex:
22752275
self.logger.info(ex)
2276-
self.assertEqual(str(ex), "The PUT request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_set_requests_put.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
2276+
self.assertEqual(str(ex), "The PUT request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
22772277
got_exception = True
22782278

22792279
self.assertTrue(got_exception)
@@ -2369,7 +2369,7 @@ def test_data_set_delete(self, mock_delete):
23692369
data_set_delete3.delete(id = 4)
23702370
except Exception as ex:
23712371
self.logger.info(ex)
2372-
self.assertEqual(str(ex), "The DELETE request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/4 encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_set_requests_delete.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
2372+
self.assertEqual(str(ex), "The DELETE request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/4 encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
23732373
got_exception = True
23742374

23752375
self.assertTrue(got_exception)
@@ -2384,7 +2384,7 @@ def test_data_set_delete(self, mock_delete):
23842384
except Exception as ex:
23852385
self.logger.info(ex)
23862386
got_exception4 = True
2387-
self.assertEqual(str(ex), "DataSet.delete() missing 1 required positional argument: 'id'")
2387+
self.assertEqual(str(ex), "delete() missing 1 required positional argument: 'id'")
23882388

23892389
self.assertTrue(got_exception4)
23902390

@@ -3460,7 +3460,7 @@ def test_data_sets_get(self, mock_delete):
34603460
result = ds3.get()
34613461
except Exception as ex:
34623462
got_exception3 = True
3463-
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/full encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_sets_requests_get.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
3463+
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/full encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
34643464

34653465
self.assertTrue(got_exception3)
34663466

@@ -4168,7 +4168,7 @@ def test_data_layer_dimension_get(self, mock_get):
41684168
result = dld3.get(id = "3")
41694169
except Exception as ex:
41704170
got_exception3 = True
4171-
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayer_dimensions/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_dimension_requests_get.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
4171+
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayer_dimensions/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
41724172

41734173
self.assertTrue(got_exception3)
41744174

@@ -4252,7 +4252,7 @@ def test_data_layer_dimension_create(self, mock_post):
42524252
dld3 = data_layer_dimension_create3.create(data_layer_id = 3)
42534253
except Exception as ex:
42544254
self.logger.info(ex)
4255-
self.assertEqual(str(ex), "The POST request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3/datalayer_dimensions encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_dimension_requests_post.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
4255+
self.assertEqual(str(ex), "The POST request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3/datalayer_dimensions encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
42564256
got_exception3 = True
42574257

42584258
self.assertTrue(got_exception3)
@@ -4663,7 +4663,7 @@ def test_data_layer_dimensions_get(self, mock_delete):
46634663
result = dld3.get(data_layer_id = 3)
46644664
except Exception as ex:
46654665
got_exception3 = True
4666-
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3/datalayer_dimensions encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_dimensions_requests_get.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
4666+
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3/datalayer_dimensions encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
46674667

46684668
self.assertTrue(got_exception3)
46694669

@@ -5049,7 +5049,7 @@ def test_data_layer_property_get(self, mock_get):
50495049
result = dlp3.get(id = "3")
50505050
except Exception as ex:
50515051
got_exception3 = True
5052-
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayer_properties/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_property_requests_get.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
5052+
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayer_properties/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
50535053

50545054
self.assertTrue(got_exception3)
50555055

@@ -5132,7 +5132,7 @@ def test_data_layer_property_create(self, mock_post):
51325132
dlp3 = data_layer_property_create3.create(data_layer_id = 3)
51335133
except Exception as ex:
51345134
self.logger.info(ex)
5135-
self.assertEqual(str(ex), "The POST request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3/datalayer_properties encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_property_requests_post.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
5135+
self.assertEqual(str(ex), "The POST request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3/datalayer_properties encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
51365136
got_exception3 = True
51375137

51385138
self.assertTrue(got_exception3)
@@ -6409,7 +6409,7 @@ def test_data_layer_get(self, mock_get):
64096409
result = dl3.get(id = "3")
64106410
except Exception as ex:
64116411
got_exception3 = True
6412-
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_requests_get.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
6412+
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
64136413

64146414
self.assertTrue(got_exception3)
64156415

@@ -6505,7 +6505,7 @@ def test_data_layer_create(self, mock_post, mock_get):
65056505
data_layer_group = None)
65066506
except Exception as ex:
65076507
self.logger.info(ex)
6508-
self.assertEqual(str(ex), "The POST request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/3/datalayers encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_requests_post.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
6508+
self.assertEqual(str(ex), "The POST request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/3/datalayers encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
65096509
got_exception3 = True
65106510

65116511
self.assertTrue(got_exception3)
@@ -6595,7 +6595,7 @@ def test_data_layer_update(self, mock_put):
65956595
data_layer_update3.update(id = 3)
65966596
except Exception as ex:
65976597
self.logger.info(ex)
6598-
self.assertEqual(str(ex), "The PUT request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_requests_put.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
6598+
self.assertEqual(str(ex), "The PUT request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/3 encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
65996599
got_exception = True
66006600

66016601
self.assertTrue(got_exception)
@@ -6690,7 +6690,7 @@ def test_data_layer_delete(self, mock_delete):
66906690
data_layer_delete3.delete(id = 4)
66916691
except Exception as ex:
66926692
self.logger.info(ex)
6693-
self.assertEqual(str(ex), "The DELETE request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/4 encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layer_requests_delete.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
6693+
self.assertEqual(str(ex), "The DELETE request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/4 encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
66946694
got_exception = True
66956695

66966696
self.assertTrue(got_exception)
@@ -8063,7 +8063,7 @@ def test_data_layers_get(self, mock_delete):
80638063
result = dl3.get()
80648064
except Exception as ex:
80658065
got_exception3 = True
8066-
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/full encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layers_requests_get.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
8066+
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datalayers/full encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
80678067

80688068
self.assertTrue(got_exception3)
80698069

@@ -8077,7 +8077,7 @@ def test_data_layers_get(self, mock_delete):
80778077
result4 = dl4.get(data_set_id = 997)
80788078
except Exception as ex:
80798079
got_exception4 = True
8080-
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/997/datalayers encountered an unspecified error contacting the server; the request was unsuccessful, error message: mocked_data_layers_requests_get.<locals>.MockResponse.__init__() got an unexpected keyword argument 'status'")
8080+
self.assertEqual(str(ex), "The GET request to https://api.ibm.com/geospatial/run/na/core/v3/datasets/997/datalayers encountered an unspecified error contacting the server; the request was unsuccessful, error message: __init__() got an unexpected keyword argument 'status'")
80818081

80828082
self.assertTrue(got_exception4)
80838083

tests/test_query.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6120,11 +6120,11 @@ def test_point_data_as_dataframe_csv(self):
61206120
got_exception = True
61216121

61226122
self.assertFalse(got_exception)
6123-
self.assertEqual(int(query_as_df_csv.head(1)["layer_id"]), 16100)
6124-
self.assertEqual(int(query_as_df_csv.head(1)["timestamp"]), 1421528400000)
6125-
self.assertEqual(float(query_as_df_csv.head(1)["longitude"]), 139.7)
6126-
self.assertEqual(float(query_as_df_csv.head(1)["latitude"]), 35.7)
6127-
self.assertEqual(float(query_as_df_csv.head(1)["value"]), 273.918212890625)
6123+
self.assertEqual(int(query_as_df_csv["layer_id"].iloc[0]), 16100)
6124+
self.assertEqual(int(query_as_df_csv["timestamp"].iloc[0]), 1421528400000)
6125+
self.assertEqual(float(query_as_df_csv["longitude"].iloc[0]), 139.7)
6126+
self.assertEqual(float(query_as_df_csv["latitude"].iloc[0]), 35.7)
6127+
self.assertEqual(float(query_as_df_csv["value"].iloc[0]), 273.918212890625)
61286128

61296129
@mock.patch('ibmpairs.client.Client.async_get',
61306130
side_effect=mocked_download_async_get

0 commit comments

Comments
 (0)