Skip to content

Commit

Permalink
fix: preserve sheets without snippets (used wrong join). Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdt committed Aug 19, 2024
1 parent a7fed05 commit 47e3f8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/actionsheets/sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def _process_sheet_list(
snippets_data.filter(pl.col('type') == 'action').
group_by('sheet').
agg(snippets=pl.len()),
on='sheet'
on='sheet',
how='left'
)

return Actionsheets(sheets_data, snippets_data)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_sheets_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
sheets = default_sheets()


def test_langs():
assert {'python', 'r', 'stan', 'shell'}.issubset(sheets.sheets(nested=False))


def test_keywords():
assert sheets.sheets_data.schema['keywords'] == pl.List(pl.String)

Expand Down

0 comments on commit 47e3f8f

Please sign in to comment.