Skip to content

get_query_table_aliases(query) is far from being final#99

Closed
macbre wants to merge 11 commits into
macbre:masterfrom
bandrisca:master
Closed

get_query_table_aliases(query) is far from being final#99
macbre wants to merge 11 commits into
macbre:masterfrom
bandrisca:master

Conversation

@macbre
Copy link
Copy Markdown
Owner

@macbre macbre commented Feb 20, 2021

Fixes #97

added LEFT JOIN, probably need to add  more keywords like FULL OUTER JOIN, CROSS JOIN ...etc.
now handles table names starting with schema name (SCHEMA.TABLE), even table names where database is also added, e.g. "database.schema.tablename"
now processes aliases without AS 
recognizing subselects (e.g. FROM (SELECT ... ) )
missed "        prev_token = token"
@macbre
Copy link
Copy Markdown
Owner Author

macbre commented Feb 20, 2021

@bandrisca - please follow pylint suggestions and reformat the code with black.

@bandrisca
Copy link
Copy Markdown

@bandrisca - please follow pylint suggestions and reformat the code with black.

@macbre sorry, I do not know how to do that. Can you please format it for me or tell me how can I do it?

@macbre
Copy link
Copy Markdown
Owner Author

macbre commented Feb 21, 2021

@bandrisca: no worries 🙂 In order to reformat the code simply run the following:

pip install black
black .

And commit the changes made by the black tool.


As for the pylint errors - these places need some changes:

************* Module sql_metadata
sql_metadata.py:381:32: C0303: Trailing whitespace (trailing-whitespace)
sql_metadata.py:383:0: C0301: Line too long (101/100) (line-too-long)
sql_metadata.py:389:35: C0303: Trailing whitespace (trailing-whitespace)
sql_metadata.py:390:41: C0303: Trailing whitespace (trailing-whitespace)
sql_metadata.py:397:0: C0301: Line too long (114/100) (line-too-long)
sql_metadata.py:397:0: W0311: Bad indentation. Found 11 spaces, expected 12 (bad-indentation)
sql_metadata.py:402:0: C0303: Trailing whitespace (trailing-whitespace)

dependabot Bot and others added 2 commits February 22, 2021 05:31
@bandrisca
Copy link
Copy Markdown

@bandrisca: no worries 🙂 In order to reformat the code simply run the following:

pip install black
black .

And commit the changes made by the black tool.

As for the pylint errors - these places need some changes:

************* Module sql_metadata
sql_metadata.py:381:32: C0303: Trailing whitespace (trailing-whitespace)
sql_metadata.py:383:0: C0301: Line too long (101/100) (line-too-long)
sql_metadata.py:389:35: C0303: Trailing whitespace (trailing-whitespace)
sql_metadata.py:390:41: C0303: Trailing whitespace (trailing-whitespace)
sql_metadata.py:397:0: C0301: Line too long (114/100) (line-too-long)
sql_metadata.py:397:0: W0311: Bad indentation. Found 11 spaces, expected 12 (bad-indentation)
sql_metadata.py:402:0: C0303: Trailing whitespace (trailing-whitespace)

I istalled "black" and it successfully reformatted the code, but still I see the length of the lines are more than 100 chars.
Do I have to modify them manually?
Did "black" remove unwanted whitespaces and bad indentations?
I compared the original and the reformatted code but found no change.
Is there a predifined black setup for github?

@macbre
Copy link
Copy Markdown
Owner Author

macbre commented Feb 22, 2021

Please commit the changes made by black and we'll see what needs to be updated.

@bandrisca
Copy link
Copy Markdown

hi @macbre , I am not sure about what I am doing, but finally I managed to upload the formatted code. Is it ok now, or too late?

@macbre
Copy link
Copy Markdown
Owner Author

macbre commented Feb 23, 2021

@bandrisca - still no improvement. Check the outputs of the checks listed below. Additionally, unit tests do not pass for the updated functions.

@macbre
Copy link
Copy Markdown
Owner Author

macbre commented Feb 24, 2021

black passes now 🎉

@macbre
Copy link
Copy Markdown
Owner Author

macbre commented Apr 15, 2021

@bandrisca - do you need any help with this one?

@macbre
Copy link
Copy Markdown
Owner Author

macbre commented Apr 29, 2021

@bandrisca - #121 introduced a completely new SQL parser and new API. Closing this in favour of #121.

@macbre macbre closed this Apr 29, 2021
@macbre macbre removed this from the v1.12 milestone Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_query_table_aliases(query) is far from being final

2 participants