lux-org / lux

Automatically visualize your pandas dataframe via a single print! 📊 💡
Apache License 2.0
5.15k stars 365 forks source link

Update to SQLExecutor and Visualization Code Exporting #388

Closed thyneb19 closed 3 years ago

thyneb19 commented 3 years ago

Overview

Changed the SQLExecutor to use the more generalized template system. Instead of only working with Postgresql connections, the new SQLExecutor can be made compatible with a wider set of relational database systems as long as the appropriate query template file is provided. Currently we have also included templates for Postgres and MySQL databases.

Python code exporting has also been updated. The formatting has now been fixed using autopep8, and exported Lux Vis code can now be run without having to manually fix the code. In addition, a test suite has been added to ensure that the exported Vis code is executable.

Changes

Update to the SQLExecutor, now takes on the structure of the GeneralizedDBExecutor that we used to have. Also updated the code formatting for the Pandas and SQL Executors. This formatting removed line wrapping which helps clean up Lux code when exported.

Added test suite for both executors under the test_export.py file. In addition, the black formatting rules have been updated to ignore the Executor files and leave their code lines unwrapped.

codecov[bot] commented 3 years ago

Codecov Report

Merging #388 (6d1f809) into master (feeb8d4) will decrease coverage by 19.11%. The diff coverage is 27.42%.

:exclamation: Current head 6d1f809 differs from pull request most recent head c8fff34. Consider uploading reports for the commit c8fff34 to get more accurate results Impacted file tree graph

@@             Coverage Diff             @@
##           master     #388       +/-   ##
===========================================
- Coverage   85.10%   65.98%   -19.12%     
===========================================
  Files          52       55        +3     
  Lines        4034     4416      +382     
===========================================
- Hits         3433     2914      -519     
- Misses        601     1502      +901     
Impacted Files Coverage Δ
lux/core/__init__.py 86.66% <ø> (ø)
lux/core/series.py 36.11% <ø> (-19.45%) :arrow_down:
lux/executor/SQLExecutor.py 9.35% <0.00%> (-75.11%) :arrow_down:
lux/interestingness/interestingness.py 84.94% <ø> (-5.97%) :arrow_down:
lux/utils/tracing_utils.py 13.13% <13.13%> (ø)
lux/core/joinedsqltable.py 19.37% <19.37%> (ø)
lux/core/sqltable.py 21.00% <22.22%> (-52.12%) :arrow_down:
lux/_config/config.py 75.54% <50.00%> (-9.39%) :arrow_down:
lux/executor/Executor.py 78.43% <50.00%> (-3.21%) :arrow_down:
lux/utils/utils.py 86.20% <50.00%> (-9.09%) :arrow_down:
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update feeb8d4...c8fff34. Read the comment docs.