Skip to content

Commit 800706f

Browse files
committed
Fix HasColumn matcher for dataframe with duplicated columns
1 parent 17f9035 commit 800706f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/shipane_sdk/matchers/dataframe_matchers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, column_pattern):
2525
self._column_pattern = re.compile(column_pattern)
2626

2727
def _matches(self, df):
28-
return df.filter(regex=self._column_pattern).columns.size > 0
28+
return len(list(filter(self._column_pattern.match, df.columns.values))) > 0
2929

3030
def describe_to(self, description):
3131
description.append_text(u'Dataframe doesn\'t have colum matches [{0}]'.format(self._column_pattern))

0 commit comments

Comments
 (0)