-
Notifications
You must be signed in to change notification settings - Fork 124
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
Handle when column name wildcard is prefixed by table name #296
Handle when column name wildcard is prefixed by table name #296
Conversation
@sumartoyo, thanks for your PR. Please add a test case(s) that cover your changes. Then we'll review your pull request.
|
@macbre I have added the test and now it's 100% coverage. Please let me know if the test is wrong. |
@sumartoyo, |
I have re-format the test, but I think I will need to rewrite the implementation. flake8 says "C901 'Parser._resolve_nested_query' is too complex (10)". I tried to write it to be less complex (less if-else) but I don't think it's possible unless I move some logic into a new function. Is it okay to introduce a new function? Are there any conventions I can follow for creating a function? |
* Handle when column name wildcard is prefixed by table name * Add test for getting wildcard column with table prefix * Formatting tests * linter: _resolve_nested_query is complex, ignore for now Co-authored-by: Dimas <dimasjkl@gmail.com>
Resolved via #330 |
Query to reproduce:
Above code will fail when getting
parsed.columns
. But if the query of cte_one isselect * from table_one
it is succeeded.This PR add handler for
if f"{table}.*" in subparser.columns
to make above query success to parse.