Skip to content

Commit bef3320

Browse files
authored
Merge pull request #202 from bkemper24/main
fix pandas warning regarding chained assignment
2 parents 1ca6766 + 2a85cc3 commit bef3320

9 files changed

Lines changed: 9 additions & 5 deletions

File tree

swat/cas/table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3982,7 +3982,7 @@ def _topk_frequency(self, maxtie=0, skipna=True):
39823982
out = out.drop('Rank', axis=1)
39833983

39843984
if 'NumVar' in out.columns and 'CharVar' in out.columns:
3985-
out['NumVar'].fillna(out['CharVar'], inplace=True)
3985+
out.fillna({'NumVar': out['CharVar']}, inplace=True)
39863986
out.drop('CharVar', axis=1, inplace=True)
39873987
out.rename(columns=dict(NumVar='top'), inplace=True)
39883988

@@ -4379,7 +4379,7 @@ def _topk_values(self, stats=None, axis=None, skipna=True, level=None,
43794379
minmax = pd.concat(minmax)
43804380
minmax.loc[:, 'stat'] = ['max', 'min'] * int(len(minmax) / 2)
43814381
if 'NumVar' in minmax.columns and 'CharVar' in minmax.columns:
4382-
minmax['NumVar'].fillna(minmax['CharVar'], inplace=True)
4382+
minmax.fillna({'NumVar': minmax['CharVar']}, inplace=True)
43834383
minmax.rename(columns=dict(NumVar='value', Column='column'),
43844384
inplace=True)
43854385
elif 'NumVar' in minmax.columns:

swat/tests/cas/test_bygroups.py

100755100644
File mode changed.

swat/tests/cas/test_connection.py

100755100644
File mode changed.

swat/tests/cas/test_datamsg.py

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def setUp(self):
5353
swat.options.interactive_mode = False
5454
swat.options.cas.missing.int64 = -999999
5555

56-
self.s = swat.CAS(HOST, PORT, USER, PASSWD, protocol=PROTOCOL)
57-
58-
if self.s._protocol in ['http', 'https']:
56+
if PROTOCOL in ['http', 'https']:
5957
tm.TestCase.skipTest(self, 'REST does not support data messages')
6058

59+
self.s = swat.CAS(HOST, PORT, USER, PASSWD, protocol=PROTOCOL)
60+
6161
if type(self).server_type is None:
6262
# Set once per class and have every test use it.
6363
# No need to change between tests.

swat/tests/cas/test_echo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def setUp(self):
4242

4343
out = self.s.loadactionset(actionset='actionTest')
4444
if out.severity != 0:
45+
self.s.endsession()
46+
del self.s
4547
self.skipTest("actionTest failed to load")
4648

4749
def tearDown(self):

swat/tests/cas/test_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def setUp(self):
4444

4545
r = self.s.loadactionset(actionset='actionTest')
4646
if r.severity != 0:
47+
self.s.endsession()
48+
del self.s
4749
self.skipTest("actionTest failed to load")
4850

4951
self.s.loadactionset(actionset='simple')

swat/tests/cas/test_table.py

100755100644
File mode changed.

swat/tests/test_config.py

100755100644
File mode changed.

swat/tests/test_dataframe.py

100755100644
File mode changed.

0 commit comments

Comments
 (0)