Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to SQLExecutor and Visualization Code Exporting #388

Merged
merged 309 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
309 commits
Select commit Hold shift + click to select a range
b3e1e88
Parameter Bug Fix
19thyneb Nov 29, 2020
d774a41
Reference Fix in Warning
19thyneb Nov 29, 2020
9747848
Black Formatting
19thyneb Nov 29, 2020
fbafb96
Merge branch 'sql-engine' into Database-Executor
19thyneb Nov 29, 2020
ecfb434
Black formatting
19thyneb Nov 29, 2020
47ece2b
Merge remote-tracking branch 'upstream/master'
19thyneb Nov 30, 2020
3e68db3
Fix Executor Reference
19thyneb Nov 30, 2020
3a5473e
Update frame.py
dorisjlee Dec 2, 2020
68d1600
Moved set functions to global config
19thyneb Dec 2, 2020
b6a5e99
Cleaned up executor imports, Fixed issue in AltairRenderer
19thyneb Dec 3, 2020
9a1748c
Black formatting
19thyneb Dec 3, 2020
77a390d
Merged changes from Master branch, Moved Executor Parameters to Confi…
thyneb19 Dec 9, 2020
cb22f5c
Merge remote-tracking branch 'upstream/master'
19thyneb Dec 20, 2020
5223a11
Fixed Index Issue in Pandas Executor
19thyneb Dec 20, 2020
ad89594
Added tests for set_index functions
19thyneb Dec 21, 2020
4718c05
Black formatting
19thyneb Dec 21, 2020
2a7d4b2
Merge remote-tracking branch 'upstream/master'
19thyneb Dec 22, 2020
269c062
Update Pandas Executor to handle NA values
19thyneb Dec 22, 2020
79b381a
Merge branch 'master' into Database-Executor
19thyneb Dec 27, 2020
fd93cd4
Update to Config, and Compiler/Interestingness Tests
19thyneb Dec 27, 2020
7324e29
Merge branch 'sql-engine' into Database-Executor
19thyneb Dec 27, 2020
674d828
Black formatting
19thyneb Dec 27, 2020
2931442
Update Requirements.txt
19thyneb Dec 27, 2020
2fa2dca
Update to Sql-Engine (#190)
thyneb19 Dec 28, 2020
7cc9626
Update SQL Executor Documentation
19thyneb Jan 4, 2021
1d517d8
Updated SQLExecutor Example Notebook
19thyneb Jan 4, 2021
f5a358c
Merge branch 'sql-engine' into Database-Executor
19thyneb Jan 4, 2021
3a27d76
Black Formatting
19thyneb Jan 4, 2021
d187b39
Update to SQL Executor Example Notebook (#193)
thyneb19 Jan 4, 2021
1229809
Update to SQL Executor Tests
19thyneb Jan 4, 2021
c405f67
Update Travis file and SQL Executor Tests
19thyneb Jan 5, 2021
7eb665e
Merge branch 'sql-engine' into Database-Executor
thyneb19 Jan 5, 2021
86a35fa
Update .travis.yml
19thyneb Jan 5, 2021
d539b83
Merge branch 'Database-Executor' of https://github.com/thyneb19/lux i…
19thyneb Jan 5, 2021
d3819b7
Merge pull request #196 from thyneb19/Database-Executor
thyneb19 Jan 5, 2021
06a8b9c
Merging changes
dj-khandelwal Jan 7, 2021
50a36e8
fixed merge conflict issues. vis.data shows None DF.
dj-khandelwal Jan 8, 2021
7479129
Merging changes
dj-khandelwal Jan 8, 2021
3966521
Merge master into sql-engine + minor mergeconflict fixes
dj-khandelwal Jan 8, 2021
6d1ad6c
Removing the PYNB
dj-khandelwal Jan 8, 2021
085f036
Cleaning up obsolete code
dj-khandelwal Jan 8, 2021
289f670
Merging the master branch changes into sql-engine (#208)
dj-khandelwal Jan 9, 2021
812a27e
Merging changes after the travis yml script fix
dj-khandelwal Jan 10, 2021
0ed2f0e
Merge conflicts resolved
dj-khandelwal Jan 10, 2021
af0e742
Updating sql-engine after merge with the travis build fix (#213)
dj-khandelwal Jan 10, 2021
96a3742
Merged in SQL-Engine changes, Cleaned up method to connect Lux to SQL…
19thyneb Jan 10, 2021
522c616
Merge pull request #214 from thyneb19/Database-Executor
thyneb19 Jan 10, 2021
973a93e
Fixed SQLExecutor's Variable Handling
19thyneb Jan 12, 2021
97d1281
Black Formatting
19thyneb Jan 19, 2021
395dfd6
Merge pull request #236 from thyneb19/Database-Executor
thyneb19 Jan 19, 2021
04e449f
Merge remote-tracking branch 'upstream/master' into Database-Executor
19thyneb Jan 19, 2021
0defa44
Updated data_type reference in SQLExecutor
19thyneb Jan 19, 2021
02906f9
Update Datetime Numeric Check
19thyneb Jan 21, 2021
56ff766
Merge pull request #237 from thyneb19/Database-Executor
thyneb19 Jan 21, 2021
9a96c55
Update travis file to generate Postgres Test DB
19thyneb Jan 21, 2021
daf9c83
Merge remote-tracking branch 'upstream/master' into Database-Executor
19thyneb Jan 21, 2021
5d9a999
Update test_vis.py
19thyneb Jan 21, 2021
105942a
Merge pull request #238 from thyneb19/Database-Executor
thyneb19 Jan 21, 2021
fabdf2e
Merging from lux/sql-engine
dj-khandelwal Jan 23, 2021
15f290e
Improved SQLExecutor Warning Handling, Bugfix with 2D Binning
19thyneb Feb 8, 2021
cfdbf16
Adjustment to AltairRenderer
19thyneb Feb 10, 2021
660655c
Merge remote-tracking branch 'upstream/master' into Database-Executor
19thyneb Feb 10, 2021
04b43dc
Merge branch 'sql-engine' into Database-Executor
19thyneb Feb 10, 2021
1b8b99d
Black Formatting
19thyneb Feb 10, 2021
4fd9a00
Merge pull request #261 from thyneb19/Database-Executor
thyneb19 Feb 10, 2021
ca8065a
Merge branch 'sql-engine' of https://github.com/lux-org/lux into sql-…
dj-khandelwal Feb 11, 2021
8327fda
Added Better Null Value Handling to SQLExecutor
19thyneb Feb 15, 2021
a7e2220
SQLExecutor execute_binning Fixes
19thyneb Feb 18, 2021
4394ad6
Update SQLExecutor Tests
19thyneb Feb 18, 2021
d0ed14a
Black Formatting
19thyneb Feb 18, 2021
3e649c2
Merge branch 'sql-engine' into Database-Executor
19thyneb Feb 18, 2021
b985393
Merge pull request #267 from thyneb19/Database-Executor
thyneb19 Feb 18, 2021
6134ce5
Merge branch 'sql-engine' of https://github.com/lux-org/lux into sql-…
dj-khandelwal Feb 18, 2021
43e0e63
Removing Test Print Statement
19thyneb Feb 18, 2021
b3ee36a
Optimizing SQLExecutor 2D Binning
19thyneb Feb 20, 2021
de1e0a1
Black Formatting
19thyneb Feb 20, 2021
4572dd2
Merge branch 'sql-engine' into Database-Executor
19thyneb Feb 21, 2021
5b0cd2b
Merge pull request #283 from thyneb19/Database-Executor
thyneb19 Feb 21, 2021
c1ea16d
Merge branch 'sql-engine' of https://github.com/lux-org/lux into sql-…
dj-khandelwal Feb 22, 2021
c8dfa12
Added Null Value Filtering to SQLExecutor
19thyneb Feb 23, 2021
cfa67b7
Merge remote-tracking branch 'upstream/master' into Database-Executor
19thyneb Feb 23, 2021
180556c
Fixed Handling of String Filter Values
19thyneb Feb 25, 2021
45d6c07
Added Better Handling for Lazy Execution
19thyneb Feb 26, 2021
46f441c
Merge pull request #288 from thyneb19/Database-Executor
thyneb19 Feb 26, 2021
06e0919
Merge branch 'sql-engine' of https://github.com/lux-org/lux into sql-…
dj-khandelwal Feb 26, 2021
4fa1534
Updated Heatmap Threshold
19thyneb Feb 26, 2021
18eb80d
Updated SQLExecutor to Not Include Null Values in Metadata
19thyneb Feb 27, 2021
4c19e4d
Black formatting
19thyneb Feb 27, 2021
84d824e
Merge remote-tracking branch 'upstream/master' into Database-Executor
19thyneb Mar 2, 2021
d4ee7da
Merge pull request #292 from thyneb19/Database-Executor
thyneb19 Mar 2, 2021
7027d2c
Merge remote-tracking branch 'upstream/master' into Database-Executor
19thyneb Mar 6, 2021
650355f
Fixed Issue with SQLExecutor and Custom Actions
19thyneb Mar 6, 2021
a1dea61
Merge pull request #300 from thyneb19/Database-Executor
thyneb19 Mar 10, 2021
2dab7ed
Created LuxSQLTable Object
thyneb19 Mar 12, 2021
e36c8a1
Merge pull request #303 from thyneb19/Database-Executor
thyneb19 Mar 12, 2021
04591af
Merge remote-tracking branch 'upstream/master' into Database-Executor
thyneb19 Mar 13, 2021
fa917fb
Added query parameter to Vis objects
thyneb19 Mar 13, 2021
2876de9
Some minor datatype detection changes to SQLExecutor
dj-khandelwal Mar 13, 2021
df3ee00
Fresh pull merge
dj-khandelwal Mar 13, 2021
c3de6c6
Revert "Added query parameter to Vis objects"
thyneb19 Mar 14, 2021
ce2017b
Merge pull request #305 from thyneb19/Database-Executor
thyneb19 Mar 14, 2021
4019070
Update python-app.yml to set up Postgres in test instance
thyneb19 Mar 14, 2021
bca4e5e
Removed Example Notebooks for SQLExecutor
thyneb19 Mar 14, 2021
d19d2c2
Update to Script Uploading Car dataset to Postgres
thyneb19 Mar 14, 2021
a7134b0
Update python-app.yml
thyneb19 Mar 14, 2021
af0fe9d
Merge pull request #307 from thyneb19/Database-Executor
thyneb19 Mar 14, 2021
626cc5f
Update Lux SQLTable Frontend
thyneb19 Mar 16, 2021
0d1c557
Delete sql_benchmarking.csv
thyneb19 Mar 16, 2021
3a0fbd2
Update CONTRIBUTING.md
dorisjlee Mar 16, 2021
87fe7d7
Update CONTRIBUTING.md
dorisjlee Mar 16, 2021
916f73a
cleaning up PR
dorisjlee Mar 16, 2021
4ad6ec4
fix flights data upload
dorisjlee Mar 16, 2021
6fe8433
Some changes for length calculation
dj-khandelwal Mar 17, 2021
2fcfb8f
Merging changes after the update for the setup script for GitHub test…
dj-khandelwal Mar 17, 2021
b1b56d7
Test Commit of SQLTable
sophiahhuang Mar 17, 2021
be2d1a2
Cleaned Up Test Suite
thyneb19 Mar 17, 2021
e8f6106
Some changes to datatype, test SQL Executor, count queries to count(1…
dj-khandelwal Mar 18, 2021
e2e1482
removing travis.tml and date_utils import from sqlexecutor
dj-khandelwal Mar 18, 2021
a6bd2fe
Merge pull request #311 from dj-khandelwal/sql-engine
thyneb19 Mar 18, 2021
799f47d
Merge branch 'sql-engine' into Database-Executor
thyneb19 Mar 18, 2021
8f1e21f
Clean up LuxSQLTable
thyneb19 Mar 18, 2021
0e760c2
Merge remote-tracking branch 'upstream/master' into Database-Executor
thyneb19 Mar 18, 2021
7f5c1b8
Update test_vis.py
thyneb19 Mar 18, 2021
247387d
Merge pull request #312 from thyneb19/Database-Executor
thyneb19 Mar 18, 2021
460e6e2
Black Formatting
thyneb19 Mar 18, 2021
c8a9471
Merge pull request #313 from thyneb19/Database-Executor
thyneb19 Mar 18, 2021
34b5c45
Updated LuxSQLTable notification
sophiahhuang Mar 19, 2021
39d8f41
Merge branch 'sql-engine' into sql-engine
thyneb19 Mar 19, 2021
d68b16d
Remove Out of Date LuxSQLTableNotice
sophiahhuang Mar 19, 2021
f190a55
Black Reformatting
thyneb19 Mar 19, 2021
fcad97a
Merge pull request #314 from sophiahhuang/sql-engine
thyneb19 Mar 19, 2021
ae26397
Remove redundantly added parameters
thyneb19 Mar 19, 2021
562be13
Update config error handling and LuxSQLTable description
thyneb19 Mar 22, 2021
e6b2f29
Clean up Vis.py Add greater connection visibility in LuxSQLTable
thyneb19 Mar 23, 2021
d9073af
Merge remote-tracking branch 'upstream/master' into Database-Executor
thyneb19 Mar 23, 2021
922f2a7
Update executor.rst
thyneb19 Mar 23, 2021
7b67f06
Refactor length parameter to _length
thyneb19 Mar 25, 2021
0323be0
Update test_interestingness.py
thyneb19 Mar 25, 2021
bea42cc
Added _length Parameter to LuxSQLTable
thyneb19 Mar 25, 2021
e9afa92
Black Reformatting, Reverting_length change in LuxDataFrame
thyneb19 Mar 25, 2021
d296c9b
Merge remote-tracking branch 'upstream/master' into Database-Executor
thyneb19 Mar 26, 2021
7c7dcd3
Update LuxSQLTable __len__() and metadata computation
thyneb19 Mar 26, 2021
8d6cf4b
Removed unnecessary __repr__() function
thyneb19 Mar 26, 2021
e350ab4
Updated LuxSQLTable repr
thyneb19 Mar 26, 2021
5d1a2f4
Revert "Updated LuxSQLTable repr"
thyneb19 Mar 27, 2021
48c1b57
Revert "Revert "Updated LuxSQLTable repr""
thyneb19 Mar 27, 2021
b5998c7
Revert "Update LuxSQLTable __len__() and metadata computation"
thyneb19 Mar 27, 2021
75c5cae
Merge pull request #327 from thyneb19/Database-Executor
thyneb19 Mar 27, 2021
6f597c2
Revert "Revert "Update LuxSQLTable __len__() and metadata computation""
thyneb19 Mar 27, 2021
7999ad6
Cleaned up datatype and SQLExecutor checks
thyneb19 Apr 3, 2021
db736d1
Update LuxSQLTable __len__() and metadata computation"" (#331)
thyneb19 Apr 7, 2021
e92dbd6
Merge branch 'sql-engine' into Database-Executor
thyneb19 Apr 7, 2021
5399097
Merge remote-tracking branch 'upstream/master' into Database-Executor
thyneb19 Apr 7, 2021
2d24a3b
Merge pull request #347 from thyneb19/Database-Executor
thyneb19 Apr 8, 2021
6922d3b
Black Reformatting
thyneb19 Apr 8, 2021
bf3cb0f
Merge pull request #348 from thyneb19/Database-Executor
thyneb19 Apr 8, 2021
694c7d7
Update executor.rst
NiStannum Apr 9, 2021
40b85b1
minor changes to requirements and cleanup
dorisjlee Apr 11, 2021
2298f13
Merge branch 'master' into sql-engine
dorisjlee Apr 11, 2021
801f3cd
Removed psycopg2 from Lux requirements
thyneb19 Apr 11, 2021
284f5ba
Merge branch 'sql-engine' into Database-Executor
thyneb19 Apr 11, 2021
1e02ad6
Merge pull request #352 from thyneb19/Database-Executor
thyneb19 Apr 11, 2021
68c7747
Merge remote-tracking branch 'upstream/master' into Database-Executor
thyneb19 Apr 11, 2021
f11e772
Revert "Merge remote-tracking branch 'upstream/master' into Database-…
thyneb19 Apr 11, 2021
a309361
Merge branch 'Database-Executor' of https://github.com/thyneb19/lux i…
thyneb19 Apr 11, 2021
1632005
Merge pull request #353 from thyneb19/Database-Executor
thyneb19 Apr 11, 2021
c94b5a6
add back merged overridden changes
dorisjlee Apr 11, 2021
50f8562
merge conflict fixed
dorisjlee Apr 11, 2021
f1268ef
Separate Pandas and SQL test suite
thyneb19 Apr 12, 2021
edaad70
Separate Pandas and SQL test suite (#354)
thyneb19 Apr 12, 2021
549c1fd
Merge remote-tracking branch 'upstream/master' into Database-Executor
thyneb19 Apr 12, 2021
5600bbd
Merge branch 'sql-engine' into Database-Executor
thyneb19 Apr 12, 2021
5f1d10c
Merge pull request #355 from thyneb19/Database-Executor
thyneb19 Apr 12, 2021
94f9aa1
Black reformatting
thyneb19 Apr 12, 2021
8da2a6b
Update python-app.yml
dorisjlee Apr 12, 2021
aa66626
Fixing issues in test suite
thyneb19 Apr 12, 2021
51133a3
Fixing Lux SQL test suite
thyneb19 Apr 12, 2021
a6cef02
Added documentation for SQL Executor.
NiStannum Apr 15, 2021
1933463
Merge pull request #361 from NiStannum/sql-engine
thyneb19 Apr 15, 2021
20619e4
Update gif link in Executor documentation
thyneb19 Apr 16, 2021
d04b8fc
writing changes to documentation
dorisjlee Apr 16, 2021
34c2276
Update executor.rst
thyneb19 Apr 16, 2021
a6d524c
changes to docs
dorisjlee Apr 17, 2021
3d7b447
merge conflict resolved
dorisjlee Apr 17, 2021
3b84282
typo
dorisjlee Apr 17, 2021
5c6935f
Update Metadata Handling
thyneb19 Apr 23, 2021
c0ff273
Added LuxTracer
thyneb19 Apr 25, 2021
7d79328
Added GeneralDatabaseExecutor
thyneb19 Apr 26, 2021
3a7d0b6
Added additional code parameters to Vis objects
thyneb19 Apr 27, 2021
8c380bc
Updated Lux Tracing
thyneb19 Apr 27, 2021
96cb9f0
Update PandasExecutor.py
thyneb19 Apr 27, 2021
6ef2e52
Update test_pandas_coverage.py
thyneb19 Apr 27, 2021
c504998
Merge remote-tracking branch 'upstream/master' into Tracing
thyneb19 Apr 27, 2021
fb3b908
Update AltairRenderer.py
thyneb19 Apr 27, 2021
8efea47
Merge branch 'Database-Executor' into General-DB-Executor
thyneb19 Apr 27, 2021
f252c6a
Started work on MYSQL generalized database executor
thyneb19 Apr 27, 2021
7f36df7
Updated GeneralDatabaseExecutor
thyneb19 Apr 28, 2021
d21b102
Updated Lux Code Tracing
thyneb19 Apr 30, 2021
19ceaf4
Update PandasExecutor.py
thyneb19 May 1, 2021
8bba390
Updated tracing_utils.py and the format of Executors
thyneb19 May 3, 2021
03cc858
Merge branch 'General-DB-Executor' into Capstone
thyneb19 May 3, 2021
121d6fb
Cleaned up Executors
thyneb19 May 3, 2021
b802545
Added Example Notebooks for Lux Tracing and the General Database Exec…
thyneb19 May 3, 2021
db649fa
Update to General Database Executor and Query Templates
thyneb19 May 6, 2021
4c5632c
Update Lux Config to default to SQL Executor
thyneb19 May 6, 2021
18c968e
Merge pull request #374 from thyneb19/Capstone
thyneb19 May 6, 2021
731ced6
Adding the JoinedSQLTable Class
dj-khandelwal May 11, 2021
12d1c76
Merging Changes for JoinedSQLTable
dj-khandelwal May 11, 2021
f8a49b0
Adding the check_if_id_like_fors_sql method
dj-khandelwal May 11, 2021
2ae9ef7
Merge pull request #375 from dj-khandelwal/sql-engine
thyneb19 May 11, 2021
d5dbbfa
Update to Code tracing and Generalized Database Executor
thyneb19 May 27, 2021
a23ac63
Updated MySQL template and Heatmap Handling for GeneralDatabase Executor
thyneb19 Jun 1, 2021
dd252bb
Update GeneralDatabaseExecutor.py
thyneb19 Jun 3, 2021
4b62cf3
Consolidated SQL Executors
thyneb19 Jun 4, 2021
5fdc6a1
Merge remote-tracking branch 'upstream/master' into Capstone
thyneb19 Jun 4, 2021
ad2e287
Fixed code formatting and PandasExecutor bug for code Export
thyneb19 Jun 7, 2021
4603d5d
Update Lux Code Tracing
thyneb19 Jun 10, 2021
43d1255
Added tests for Lux code export
thyneb19 Jun 14, 2021
a196020
Added Code export tests for Lux PandasExecutor
thyneb19 Jun 17, 2021
0402bf7
Fixed indentation issue in code tracing, updated code export tests
thyneb19 Jun 17, 2021
04bab06
Merge remote-tracking branch 'upstream/master' into General-DB-Executor
thyneb19 Jun 22, 2021
ea10789
Black formatting
thyneb19 Jun 23, 2021
d6aff00
Update black file exclusions
thyneb19 Jun 23, 2021
196fc12
Merge remote-tracking branch 'upstream/master' into General-DB-Executor
thyneb19 Jun 23, 2021
1a695e2
Merge pull request #387 from thyneb19/General-DB-Executor
thyneb19 Jun 23, 2021
68a85f6
Update requirements.txt
thyneb19 Jun 23, 2021
a2e3fd7
Updated path references
thyneb19 Jun 30, 2021
90f5322
Black reformatting
thyneb19 Jun 30, 2021
a8814b2
Added script to upload airbnb_nyc data to test suite
thyneb19 Jul 1, 2021
e4f50b3
Update upload_airbnb_nyc_data.py
thyneb19 Jul 1, 2021
a484767
Black reformatting
thyneb19 Jul 1, 2021
317056d
Update SQL tests
thyneb19 Jul 1, 2021
31d6dfb
Cleaned up SQL tests
thyneb19 Jul 1, 2021
a5bbb1b
Black reformatting
thyneb19 Jul 1, 2021
42d5d9e
Update to SQL Templates and Code Export
thyneb19 Jul 6, 2021
3ad5e67
Updated Altair Code Export
thyneb19 Jul 7, 2021
f465675
Black Reformatting
thyneb19 Jul 7, 2021
60864ca
Update plot_data function
thyneb19 Jul 17, 2021
78a1484
Merge remote-tracking branch 'upstream/master' into sql-engine
thyneb19 Jul 17, 2021
48a4d92
Black reformatting
thyneb19 Jul 17, 2021
4a18cbc
Updated Python Code Tracing
thyneb19 Aug 3, 2021
82d46f2
Formatting Changes for Exported Executor Code
thyneb19 Aug 6, 2021
a6ab295
Black Reformatting
thyneb19 Aug 6, 2021
c745d3b
Update Code Export Tests
thyneb19 Aug 6, 2021
9dc1451
Black Reformatting
thyneb19 Aug 7, 2021
455362f
Merge remote-tracking branch 'upstream/master' into sql-engine
thyneb19 Aug 7, 2021
4820413
Added Lux Config Parameter for Heatmap Threshold
thyneb19 Aug 7, 2021
81049d2
Update Lux Code Export Tests
thyneb19 Aug 10, 2021
3325119
Fix to heatmap determination in SQLExecutor
thyneb19 Aug 10, 2021
c8fff34
remove broken test
dorisjlee Sep 10, 2021
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
1 change: 1 addition & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
run: |
python lux/data/upload_car_data.py
python lux/data/upload_aug_test_data.py
python lux/data/upload_airbnb_nyc_data.py
- name: Lint check with black
run: |
black --target-version py37 --line-length 105 --check .
Expand Down
138 changes: 138 additions & 0 deletions examples/GeneralDatabase_Executor_Example.py.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "expected-facility",
"metadata": {},
"source": [
"This notebook is an example of how to use the General Database Executor in Lux. This execution backend allows users to switch what kind of queries are being used to query their database system. Here we show how to switch from using a SQL template for Postgresql to MySQL."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "helpful-liberty",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "97a93a0b783743fab041362d66d72125",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Button(description='Toggle Table/Lux', layout=Layout(bottom='6px', top='6px', width='200px'), style=ButtonStyl…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e216a8adf9584b6e8a3cc5374ae73209",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import sys\n",
"sys.path.insert(1, 'C:\\\\Users\\\\thyne\\\\Documents\\\\GitHub\\\\lux')\n",
"\n",
"import lux\n",
"import psycopg2\n",
"import pandas as pd\n",
"from lux import LuxSQLTable\n",
"\n",
"connection = psycopg2.connect(\"host=localhost user=postgres password=lux dbname=postgres\")\n",
"lux.config.set_SQL_connection(connection)\n",
"lux.config.read_query_template(\"postgres_query_template.txt\")\n",
"lux.config.quoted_queries = True\n",
"\n",
"sql_tbl = LuxSQLTable(table_name='car')\n",
"sql_tbl.intent = [\"Cylinders\"]\n",
"sql_tbl"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "searching-nancy",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a2c12d8447494178aa6c38fc0a4c59f6",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Button(description='Toggle Table/Lux', layout=Layout(bottom='6px', top='6px', width='200px'), style=ButtonStyl…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "26b23f594155417e9fb7ff2b4695477c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import sqlalchemy\n",
"import lux\n",
"from sqlalchemy.ext.declarative import declarative_base\n",
"\n",
"engine = sqlalchemy.create_engine('mysql+mysqlconnector://luxuser:lux@localhost:3306/sys',echo=False)\n",
"lux.config.set_SQL_connection(engine)\n",
"lux.config.read_query_template(\"mysql_query_template.txt\")\n",
"lux.config.quoted_queries = False\n",
"\n",
"sql_df = lux.LuxSQLTable(table_name='car')\n",
"\n",
"sql_df.intent = ['Cylinders']\n",
"sql_df"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
733 changes: 733 additions & 0 deletions examples/Lux_Code_Tracing.ipynb

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions examples/mysql_query_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
preview_query:SELECT * from {table_name} LIMIT {num_rows}
length_query:SELECT COUNT(*) as length FROM {table_name} {where_clause}
sample_query:SELECT * FROM {table_name} {where_clause} LIMIT {num_rows}
scatter_query:SELECT {columns} FROM {table_name} {where_clause}
colored_barchart_counts:SELECT {groupby_attr}, {color_attr}, COUNT({groupby_attr}) as count FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_average:SELECT {groupby_attr}, {color_attr}, AVG({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_sum:SELECT {groupby_attr}, {color_attr}, SUM({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_max:SELECT {groupby_attr}, {color_attr}, MAX({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
barchart_counts:SELECT {groupby_attr}, COUNT({groupby_attr}) as count FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_average:SELECT {groupby_attr}, AVG({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_sum:SELECT {groupby_attr}, SUM({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_max:SELECT {groupby_attr}, MAX({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
histogram_counts:SELECT width_bucket, count(width_bucket) as count from (SELECT ({bucket_cases}) as width_bucket from {table_name} {where_clause}) as buckets GROUP BY width_bucket order by width_bucket
heatmap_counts:SELECT width_bucket1, width_bucket2, count(*) as count FROM (SELECT ({bucket_cases1}) as width_bucket1, ({bucket_cases2}) as width_bucket2 FROM {table_name} {where_clause}) as labeled_data GROUP BY width_bucket1, width_bucket2
table_attributes_query:SELECT COLUMN_NAME as column_name FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '{table_name}'
min_max_query:SELECT MIN({attribute}) as min, MAX({attribute}) as max FROM {table_name}
cardinality_query:SELECT COUNT(Distinct({attribute})) as count FROM {table_name} WHERE {attribute} IS NOT NULL
unique_query:SELECT Distinct({attribute}) FROM {table_name} WHERE {attribute} IS NOT NULL
datatype_query:SELECT DATA_TYPE as data_type FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '{table_name}' AND COLUMN_NAME = '{attribute}'
19 changes: 19 additions & 0 deletions examples/postgres_query_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
preview_query:SELECT * from {table_name} LIMIT {num_rows}
length_query:SELECT COUNT(1) as length FROM {table_name} {where_clause}
sample_query:SELECT * FROM {table_name} {where_clause} ORDER BY random() LIMIT {num_rows}
scatter_query:SELECT {columns} FROM {table_name} {where_clause}
colored_barchart_counts:SELECT "{groupby_attr}", "{color_attr}", COUNT("{groupby_attr}") FROM {table_name} {where_clause} GROUP BY "{groupby_attr}", "{color_attr}"
colored_barchart_average:SELECT "{groupby_attr}", "{color_attr}", AVG("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}", "{color_attr}"
colored_barchart_sum:SELECT "{groupby_attr}", "{color_attr}", SUM("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}", "{color_attr}"
colored_barchart_max:SELECT "{groupby_attr}", "{color_attr}", MAX("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}", "{color_attr}"
barchart_counts:SELECT "{groupby_attr}", COUNT("{groupby_attr}") FROM {table_name} {where_clause} GROUP BY "{groupby_attr}"
barchart_average:SELECT "{groupby_attr}", AVG("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}"
barchart_sum:SELECT "{groupby_attr}", SUM("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}"
barchart_max:SELECT "{groupby_attr}", MAX("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}"
histogram_counts:SELECT width_bucket, COUNT(width_bucket) FROM (SELECT width_bucket(CAST ("{bin_attribute}" AS FLOAT), '{upper_edges}') FROM {table_name} {where_clause}) as Buckets GROUP BY width_bucket ORDER BY width_bucket
heatmap_counts:SELECT width_bucket1, width_bucket2, count(*) FROM (SELECT width_bucket(CAST ("{x_attribute}" AS FLOAT), '{x_upper_edges_string}') as width_bucket1, width_bucket(CAST ("{y_attribute}" AS FLOAT), '{y_upper_edges_string}') as width_bucket2 FROM {table_name} {where_clause}) as foo GROUP BY width_bucket1, width_bucket2
table_attributes_query:SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '{table_name}'
min_max_query:SELECT MIN("{attribute}") as min, MAX("{attribute}") as max FROM {table_name}
cardinality_query:SELECT Count(Distinct("{attribute}")) FROM {table_name} WHERE "{attribute}" IS NOT NULL
unique_query:SELECT Distinct("{attribute}") FROM {table_name} WHERE "{attribute}" IS NOT NULL
datatype_query:SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '{table_name}' AND COLUMN_NAME = '{attribute}'
23 changes: 23 additions & 0 deletions examples/query_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
##############################################################################
#########################Example Query Template #########################
# Details on query function see: https://readthedocs... ##
##############################################################################
preview_query:
length_query:
sample_query:
scatter_query:
colored_barchart_counts:SELECT {groupby_attr}, {color_attr}, COUNT({groupby_attr}) as count FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_average:SELECT {groupby_attr}, {color_attr}, AVG({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_sum:SELECT {groupby_attr}, {color_attr}, SUM({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_max:SELECT {groupby_attr}, {color_attr}, MAX({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
barchart_counts:SELECT {groupby_attr}, COUNT({groupby_attr}) as count FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_average:SELECT {groupby_attr}, AVG({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_sum:SELECT {groupby_attr}, SUM({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_max:SELECT {groupby_attr}, MAX({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
histogram_counts:SELECT width_bucket, count(width_bucket) as count from (SELECT ({bucket_cases}) as width_bucket from {table_name} {where_clause}) as buckets GROUP BY width_bucket order by width_bucket
heatmap_counts:SELECT width_bucket1, width_bucket2, count(*) as count FROM (SELECT ({bucket_cases1}) as width_bucket1, ({bucket_cases2}) as width_bucket2 FROM {table_name} {where_clause}) as labeled_data GROUP BY width_bucket1, width_bucket2
table_attributes_query:SELECT COLUMN_NAME as column_name FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '{table_name}'
min_max_query:SELECT MIN({attribute}) as min, MAX({attribute}) as max FROM {table_name}
cardinality_query:SELECT COUNT(Distinct({attribute})) as count FROM {table_name} WHERE {attribute} IS NOT NULL
unique_query:SELECT Distinct({attribute}) FROM {table_name} WHERE {attribute} IS NOT NULL
datatype_query:SELECT DATA_TYPE as data_type FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '{table_name}' AND COLUMN_NAME = '{attribute}'
2 changes: 2 additions & 0 deletions lux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from lux.vis.Clause import Clause
from lux.core.frame import LuxDataFrame
from lux.core.sqltable import LuxSQLTable
from lux.core.joinedsqltable import JoinedSQLTable
from lux.utils.tracing_utils import LuxTracer
from ._version import __version__, version_info
from lux._config import config
from lux._config.config import warning_format
Expand Down
25 changes: 25 additions & 0 deletions lux/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
from typing import Any, Callable, Dict, Iterable, List, Optional, Union
import lux
import warnings
from lux.utils.tracing_utils import LuxTracer
import os
from lux._config.template import postgres_template, mysql_template

RegisteredOption = namedtuple("RegisteredOption", "name action display_condition args")

Expand All @@ -32,13 +35,18 @@ def __init__(self):
self._pandas_fallback = True
self._interestingness_fallback = True
self.heatmap_bin_size = 40
self.tracer_relevant_lines = []
self.tracer = LuxTracer()
self.query_templates = {}
self.handle_quotes = True
#####################################
#### Optimization Configurations ####
#####################################
self._sampling_start = 100000
self._sampling_cap = 1000000
self._sampling_flag = True
self._heatmap_flag = True
self._heatmap_start = 5000
self.lazy_maintain = True
self.early_pruning = True
self.early_pruning_sample_cap = 30000
Expand Down Expand Up @@ -377,11 +385,28 @@ def set_SQL_connection(self, connection):
self.set_executor_type("SQL")
self.SQLconnection = connection

def read_query_template(self, query_template):
from lux.executor.SQLExecutor import SQLExecutor

query_dict = {}
if type(query_template) is str:
for line in query_template.split("\n"):
(key, val) = line.split(":")
query_dict[key] = val.strip()
else:
with open(query_file) as f:
for line in f:
(key, val) = line.split(":")
query_dict[key] = val.strip()
self.query_templates = query_dict
self.executor = SQLExecutor()

def set_executor_type(self, exe):
if exe == "SQL":
from lux.executor.SQLExecutor import SQLExecutor

self.executor = SQLExecutor()
self.read_query_template(postgres_template)
elif exe == "Pandas":
from lux.executor.PandasExecutor import PandasExecutor

Expand Down
19 changes: 19 additions & 0 deletions lux/_config/mysql_query_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
preview_query:SELECT * from {table_name} LIMIT {num_rows}
length_query:SELECT COUNT(*) as length FROM {table_name} {where_clause}
sample_query:SELECT * FROM {table_name} {where_clause} LIMIT {num_rows}
scatter_query:SELECT {columns} FROM {table_name} {where_clause}
colored_barchart_counts:SELECT {groupby_attr}, {color_attr}, COUNT({groupby_attr}) as count FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_average:SELECT {groupby_attr}, {color_attr}, AVG({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_sum:SELECT {groupby_attr}, {color_attr}, SUM({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
colored_barchart_max:SELECT {groupby_attr}, {color_attr}, MAX({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}, {color_attr}
barchart_counts:SELECT {groupby_attr}, COUNT({groupby_attr}) as count FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_average:SELECT {groupby_attr}, AVG({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_sum:SELECT {groupby_attr}, SUM({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
barchart_max:SELECT {groupby_attr}, MAX({measure_attr}) as {measure_attr} FROM {table_name} {where_clause} GROUP BY {groupby_attr}
histogram_counts:SELECT width_bucket, count(width_bucket) as count from (SELECT ({bucket_cases}) as width_bucket from {table_name} {where_clause}) as buckets GROUP BY width_bucket order by width_bucket
heatmap_counts:SELECT width_bucket1, width_bucket2, count(*) as count FROM (SELECT ({bucket_cases1}) as width_bucket1, ({bucket_cases2}) as width_bucket2 FROM {table_name} {where_clause}) as labeled_data GROUP BY width_bucket1, width_bucket2
table_attributes_query:SELECT COLUMN_NAME as column_name FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '{table_name}'
min_max_query:SELECT MIN({attribute}) as min, MAX({attribute}) as max FROM {table_name}
cardinality_query:SELECT COUNT(Distinct({attribute})) as count FROM {table_name} WHERE {attribute} IS NOT NULL
unique_query:SELECT Distinct({attribute}) FROM {table_name} WHERE {attribute} IS NOT NULL
datatype_query:SELECT DATA_TYPE as data_type FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '{table_name}' AND COLUMN_NAME = '{attribute}'
19 changes: 19 additions & 0 deletions lux/_config/postgres_query_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
preview_query:SELECT * from {table_name} LIMIT {num_rows}
length_query:SELECT COUNT(1) as length FROM {table_name} {where_clause}
sample_query:SELECT * FROM {table_name} {where_clause} ORDER BY random() LIMIT {num_rows}
scatter_query:SELECT {columns} FROM {table_name} {where_clause}
colored_barchart_counts:SELECT "{groupby_attr}", "{color_attr}", COUNT("{groupby_attr}") FROM {table_name} {where_clause} GROUP BY "{groupby_attr}", "{color_attr}"
colored_barchart_average:SELECT "{groupby_attr}", "{color_attr}", AVG("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}", "{color_attr}"
colored_barchart_sum:SELECT "{groupby_attr}", "{color_attr}", SUM("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}", "{color_attr}"
colored_barchart_max:SELECT "{groupby_attr}", "{color_attr}", MAX("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}", "{color_attr}"
barchart_counts:SELECT "{groupby_attr}", COUNT("{groupby_attr}") FROM {table_name} {where_clause} GROUP BY "{groupby_attr}"
barchart_average:SELECT "{groupby_attr}", AVG("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}"
barchart_sum:SELECT "{groupby_attr}", SUM("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}"
barchart_max:SELECT "{groupby_attr}", MAX("{measure_attr}") as "{measure_attr}" FROM {table_name} {where_clause} GROUP BY "{groupby_attr}"
histogram_counts:SELECT width_bucket, COUNT(width_bucket) FROM (SELECT width_bucket(CAST ("{bin_attribute}" AS FLOAT), '{upper_edges}') FROM {table_name} {where_clause}) as Buckets GROUP BY width_bucket ORDER BY width_bucket
heatmap_counts:SELECT width_bucket1, width_bucket2, count(*) FROM (SELECT width_bucket(CAST ("{x_attribute}" AS FLOAT), '{x_upper_edges_string}') as width_bucket1, width_bucket(CAST ("{y_attribute}" AS FLOAT), '{y_upper_edges_string}') as width_bucket2 FROM {table_name} {where_clause}) as foo GROUP BY width_bucket1, width_bucket2
table_attributes_query:SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = '{table_name}'
min_max_query:SELECT MIN("{attribute}") as min, MAX("{attribute}") as max FROM {table_name}
cardinality_query:SELECT Count(Distinct("{attribute}")) FROM {table_name} WHERE "{attribute}" IS NOT NULL
unique_query:SELECT Distinct("{attribute}") FROM {table_name} WHERE "{attribute}" IS NOT NULL
datatype_query:SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '{table_name}' AND COLUMN_NAME = '{attribute}'
Loading