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