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 #387

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.