Skip to content

Parse SQL properly to determine from tables (for the SQL console completer) #298

Open

Description

@gdementen

Our current code at

m = re.search(r'\s+FROM\s+(\S+)', query_text, re.IGNORECASE)
uses a simple regular expression and has a lot of false positives, possibly false negatives too.

We should use Polars own SQL parser to do so instead:

https://github.com/pola-rs/polars/pull/25749/files#diff-e47976e4d2bcb9bc8182e1343108de959b3f216e480be3daaa64d416e88f386c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions