Commit Graph

117 Commits

Author SHA1 Message Date
Beto Dealmeida
0db59b45b8 fix: adhoc metrics (#30202) 2024-10-10 16:46:17 -04:00
Michael S. Molina
fc857d987b fix: Unable to parse escaped tables (#30560) 2024-10-09 13:25:44 -03:00
Beto Dealmeida
bdf29cb7c2 chore: organize SQL parsing files (#30258) 2024-09-13 16:24:19 -04:00
Beto Dealmeida
1f890718a2 feat: is_mutating method (#30177) 2024-09-09 13:56:18 -04:00
Ayush Tripathi
f5d614d80d fix: Rename database from 'couchbasedb' to 'couchbase' in documentation and db_engine_specs (#29911) 2024-08-13 07:47:43 -07:00
Ayush Tripathi
ec5bbaa678 feat: add connector for CouchbaseDB (#29225)
Co-authored-by: ayush-couchbase <ayush.tripathi@couchbase.com>
2024-07-10 11:54:36 +03:00
Beto Dealmeida
643ee17544 chore: remove duplicate code in SqlaTable (#28752) 2024-05-29 15:07:21 -04:00
Daniel Vaz Gaspar
5dfbab5424 fix: adds the ability to disallow SQL functions per engine (#28639) 2024-05-29 10:51:28 +01:00
John Bodley
27952e7057 fix: Ignore USE SQL keyword when determining SELECT statement (#28279) 2024-05-02 11:25:55 -07:00
John Bodley
d36bccdc8c fix(sql_parse): Add Apache Spark to SQLGlot dialect mapping (#28322) 2024-05-02 09:53:20 -07:00
John Bodley
c5e7d870f0 fix(sql_parse): Provide more lenient logic when extracting latest[_sub]_partition (#28152) 2024-04-25 22:02:25 -07:00
Lennard Scheibel
e889f17421 chore(translations): fix translations order (#28031) 2024-04-22 13:56:09 -06:00
John Bodley
2f11f66167 fix(sql_parse): Support Jinja format() filter when extracting latest[_sub]_partition (#28117) 2024-04-18 10:23:09 -07:00
John Bodley
c38529741e chore(sql_parse): Provide more meaningful SQLGlot errors (#27858) 2024-04-03 07:10:52 -07:00
John Bodley
5ab95aaf7d chore(sql_parse): Strip leading/trailing whitespace in Jinja macro extraction (#27842) 2024-04-02 17:08:42 -07:00
John Bodley
3ae74d1f2d fix: Provide more inclusive error handling for saved queries (#27644) 2024-03-26 16:22:14 -03:00
John Bodley
28cbedb82f fix: Leverage actual database for rendering Jinjarized SQL (#27646) 2024-03-27 08:12:25 +13:00
Beto Dealmeida
cd7972d05b feat: support for KQL in SQLScript (#27522) 2024-03-22 12:48:20 -04:00
John Bodley
b25dd0c055 fix(sql_parse): Ensure table extraction handles Jinja templating (#27470) 2024-03-22 13:39:28 +13:00
Beto Dealmeida
72a41c1642 fix: sqlglot SQL Server (#27577) 2024-03-21 17:09:40 -04:00
Beto Dealmeida
36fd3c0bf8 feat: improve _extract_tables_from_sql (#26748) 2024-03-18 13:02:58 -04:00
Beto Dealmeida
024b88a40d chore: add annotations to sql_parse.py (#27520) 2024-03-14 18:16:06 -04:00
Beto Dealmeida
26d8077e97 chore: improve SQL parsing (#26767) 2024-03-13 18:27:01 -04:00
John Bodley
2c564817f1 fix(sqlglot): Address regressions introduced in #26476 (#27217) 2024-02-24 08:47:36 +13:00
mapledan
f2bf9f72e4 fix: handle CRLF endings causing sqlglot failure (#26911) 2024-01-31 18:07:43 -08:00
Beto Dealmeida
c0b57bd1c3 feat(sqlparse): improve table parsing (#26476) 2024-01-22 11:16:50 -05:00
Beto Dealmeida
2bd611916d feat: safer insert RLS (#20323) 2023-11-08 22:52:25 -05:00
Beto Dealmeida
bb002d6147 fix: is_select with UNION (#25290) 2023-09-14 09:05:19 -07:00
Beto Dealmeida
2f68010729 fix: is_select (#25189) 2023-09-06 11:54:25 -07:00
Daniel Vaz Gaspar
357986103b fix: CTE queries with non-SELECT statements (#25014) 2023-08-19 15:49:15 +01:00
EugeneTorap
5f103072b0 fix: Python3.11 (str, Enum) issue (#24803) 2023-07-31 09:04:09 -07:00
EugeneTorap
fc89718d48 chore: Update pylint to 2.17.4 (#24700)
Co-authored-by: John Bodley <john.bodley@gmail.com>
2023-07-24 17:13:49 -07:00
John Bodley
a4d5d7c6b9 chore(pre-commit): Add pyupgrade and pycln hooks (#24197) 2023-06-01 12:01:10 -07:00
EugeneTorap
a7f9c66e57 chore: Bump sqlparse to 0.4.4 (#24045)
Co-authored-by: sebastianliebscher <liebscher.sebastian@protonmail.ch>
2023-05-23 10:15:24 +03:00
Beto Dealmeida
2a1a061a3e fix: handle comments in has_table_query (#23882) 2023-05-01 11:06:54 -07:00
Francisco Muniz de Paula Neto
e9b4022787 fix: is_select check for lowercase select with "WITH" clauses (#22370) 2023-04-18 08:59:50 -07:00
Hugh A. Miles II
b820eb8235 chore: Update pre-commit packages (#23173) 2023-03-13 17:05:13 -06:00
Josh Soref
dec6ac49f6 chore(backend): Spelling (#19677)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
2023-02-17 10:48:24 -07:00
Diego Medina
8b354b4b69 fix: Published Dashboard without charts don't show up for non admin users (#20638) 2022-07-27 12:40:59 -06:00
John Bodley
ad308fbde2 chore(rls): Remove passing global username (#20344)
* chore(rls): Remove passing global username

* Update manager.py

* Update manager.py

* Update manager.py

* Update manager.py

Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-07-05 10:51:24 -07:00
Beto Dealmeida
f2881e5bbd feat: RLS for SQL Lab (#19999)
* feat: RLS for SQL Lab

* Small fixes

* Pass username to security manager

* Update docstrings

* Add tests

* Remove type from docstring
2022-05-12 11:03:01 -07:00
Jesse Yang
231716cb50 perf: refactor SIP-68 db migrations with INSERT SELECT FROM (#19421) 2022-04-19 18:58:18 -07:00
Craig Rueda
f64d654de3 chore(database): Creating helper make_url_safe to wrap potential errors (#19526)
* Creating helper make_url_safe to wrap potential errors

* Fixing imports

* Fixing imports again

* Adding comment

* Linting

* Fixing test

* Fixing test again...

* Fixing import
2022-04-05 11:17:30 -07:00
Beto Dealmeida
6828624f61 feat: improve adhoc SQL validation (#19454)
* feat: improve adhoc SQL validation

* Small changes

* Add more unit tests
2022-03-31 11:55:19 -07:00
Ville Brofeldt
f341025d80 feat: add support for comments in adhoc clauses (#19248)
* feat: add support for comments in adhoc clauses

* sanitize remaining freeform clauses

* sanitize adhoc having in frontend

* address review comment
2022-03-18 15:08:06 -07:00
Beto Dealmeida
8234395466 feat: helper functions for RLS (#19055)
* feat: helper functions for RLS

* Add function to inject RLS

* Add UNION tests

* Add tests for schema

* Add more tests; cleanup

* has_table_query via tree traversal

* Wrap existing predicate in parenthesis

* Clean up logic

* Improve table matching
2022-03-11 14:47:11 -08:00
Sujith Kumar S
7e51b200b4 fix(mssql): support top syntax for limiting queries (#18746)
* SQL-TOP Fix For Database Engines

MSSQL is not supporting LIMIT syntax in SQLs. For limiting the rows, MSSQL having a different keyword TOP. Added fixes for handling the TOP and LIMIT clauses based on the database engines.

* Teradata code for top clause handling removed from teradata.py

Teradata code for top clause handling removed from teradata.py file, since we added generic section in base engine for the same.

* Changes to handle CTE along with TOP in complex SQLs

Added changes to handle TOP command in CTEs, for DB Engines which are not supporting inline CTEs.

* Test cases for TOP unit testing in MSSQL

Added multiple unit test cases for MSSQL top command handling and also along with CTEs

* Corrected the select_keywords name key in basengine

Corrected the select_keywords name key in basengine

* Changes based on as per review.

made the required corrections based on code review to keep good code readability and code cleanliness.

* Review changes to correct lint and typo issues

Made the changes according to the review comments.

* fix linting errors

* fix teradata tests

* add coverage

* lint

* Code cleanliness

Moved the top/limit flag check from sql_lab to core.

* Changed for code cleanliness

Changes for keeping code cleanliness

* Corrected lint issue

Corrected lint issue.

* Code cleanliness

Code cleanliness

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2022-02-21 09:58:39 +02:00
Erik Ritter
14b9298ef7 fix: revert #17654 to fix subselect table name parsing (#18017) 2022-01-12 21:28:23 -08:00
John Bodley
63ca09e345 fix: Workaround for sqlparse issue #652 (#17995)
* fix: Workaround for sqlparse issue #652

* Update superset/sql_parse.py

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>

* Update sql_parse.py

Co-authored-by: John Bodley <john.bodley@airbnb.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2022-01-12 14:03:56 +13:00
Ville Brofeldt
3a42071e0f chore(sql): clean up invalid filter clause exception types (#17702)
* chore(sql): clean up invalid filter clause exception types

* fix lint

* rename exception
2021-12-09 17:49:32 +02:00