Skip to content

Commit

Permalink
Merge pull request #313 from thyneb19/Database-Executor
Browse files Browse the repository at this point in the history
Black Reformatting
  • Loading branch information
thyneb19 committed Mar 18, 2021
2 parents 247387d + 460e6e2 commit c8a9471
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lux/core/sqltable.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ def _repr_html_(self):
)
self.output = widgets.Output()
lux.config.executor.execute_preview(self)
notice = HTML("""<style>
notice = HTML(
"""<style>
body
{
background-color:#aa0000;
}
</style>
Please note, the data shown here is just a preview of the database table. You will be unable to perform Pandas functionality on this data.""")
Please note, the data shown here is just a preview of the database table. You will be unable to perform Pandas functionality on this data."""
)

display(button, notice, self.output)

Expand Down
14 changes: 10 additions & 4 deletions tests/test_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,11 @@ def test_scatter_chart(global_var):
vis = Vis(["Acceleration", "Weight"], df)
vis_code = vis.to_matplotlib_code()
assert "ax.scatter(x_pts, y_pts, alpha=0.5)" in vis_code
assert "ax.set_xlabel(\'Acceleration\', fontsize=\'15\')" in vis_code or "ax.set_xlabel('Acceleration')" in vis_code
assert "ax.set_ylabel(\'Weight\', fontsize=\'15\')" in vis_code or "ax.set_ylabel('Weight')" in vis_code
assert (
"ax.set_xlabel('Acceleration', fontsize='15')" in vis_code
or "ax.set_xlabel('Acceleration')" in vis_code
)
assert "ax.set_ylabel('Weight', fontsize='15')" in vis_code or "ax.set_ylabel('Weight')" in vis_code


def test_colored_scatter_chart(global_var):
Expand All @@ -290,8 +293,11 @@ def test_colored_scatter_chart(global_var):
vis_code = vis.to_matplotlib_code()
assert "ax.scatter" in vis_code
assert "title='Origin'" in vis_code
assert "ax.set_xlabel(\'Acceleration\', fontsize=\'15\')" in vis_code or "ax.set_xlabel('Acceleration')" in vis_code
assert "ax.set_ylabel(\'Weight\', fontsize=\'15\')" in vis_code or "ax.set_ylabel('Weight')" in vis_code
assert (
"ax.set_xlabel('Acceleration', fontsize='15')" in vis_code
or "ax.set_xlabel('Acceleration')" in vis_code
)
assert "ax.set_ylabel('Weight', fontsize='15')" in vis_code or "ax.set_ylabel('Weight')" in vis_code


def test_line_chart(global_var):
Expand Down

0 comments on commit c8a9471

Please sign in to comment.