Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion streamz/dataframe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def __dir__(self):
o = set(dir(type(self)))
o.update(self.__dict__)
o.update(c for c in self.columns
if (isinstance(c, pd.compat.string_types) and pd.compat.isidentifier(c)))
if (isinstance(c, str) and c.isidentifier()))
return list(o)

def assign(self, **kwargs):
Expand Down
7 changes: 7 additions & 0 deletions streamz/dataframe/tests/test_dataframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,3 +1007,10 @@ def test_windowed_groupby_aggs_with_start_state(stream):
stream.emit(df)
out_df1 = pd.DataFrame({'name':['Alice', 'Bob', 'Linda', 'Tom'], 'amount':[50.0, 550.0, 100.0, 150.0]})
assert_eq(output1[-1][1].reset_index(), out_df1)


def test_dir(stream):
example = pd.DataFrame({'name': [], 'amount': []})
sdf = DataFrame(stream, example=example)
assert 'name' in dir(sdf)
assert 'amount' in dir(sdf)