Skip to content

Commit e9a2545

Browse files
authored
Merge pull request #374 from badiku/dataframe_dir
Dataframe dir
2 parents f9b4ce3 + 1631836 commit e9a2545

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

streamz/dataframe/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def __dir__(self):
245245
o = set(dir(type(self)))
246246
o.update(self.__dict__)
247247
o.update(c for c in self.columns
248-
if (isinstance(c, pd.compat.string_types) and pd.compat.isidentifier(c)))
248+
if (isinstance(c, str) and c.isidentifier()))
249249
return list(o)
250250

251251
def assign(self, **kwargs):

streamz/dataframe/tests/test_dataframes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,3 +1007,10 @@ def test_windowed_groupby_aggs_with_start_state(stream):
10071007
stream.emit(df)
10081008
out_df1 = pd.DataFrame({'name':['Alice', 'Bob', 'Linda', 'Tom'], 'amount':[50.0, 550.0, 100.0, 150.0]})
10091009
assert_eq(output1[-1][1].reset_index(), out_df1)
1010+
1011+
1012+
def test_dir(stream):
1013+
example = pd.DataFrame({'name': [], 'amount': []})
1014+
sdf = DataFrame(stream, example=example)
1015+
assert 'name' in dir(sdf)
1016+
assert 'amount' in dir(sdf)

0 commit comments

Comments
 (0)