You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sqllineage\core\parser\sqlparse\utils.py 解析SQL函数时,返回了生成器parameters ,parameters += [
tk for tk in last_token.tokens if tk.is_group or tk.ttype == Wildcard
]
报错 TypeError: unsupported operand type(s) for +=: 'generator' and 'list'
SQL
Paste the SQL text here. For example:
无法提供
To Reproduce Note here we refer to SQL provided in prior step as stored in a file named test.sql
if CLI (Command Line Interface): provide the command you're calling and the output.
For example:
elif API (Application Programming Interface): provide the python code you're using and the output.
For example:
#defget_parameters(token: Function):
""" This is a replacement for sqlparse.sql.Function.get_parameters(), which produces problematic result for: if(col1 = 'foo' AND col2 = 'bar', 1, 0) This implementation ignores the constant parameter as we don't need them for column lineage for now """last_token=token.tokens[-1]
parameters= []
ifisinstance(last_token, Over):
# special handling for window functionparameters=token.get_parameters()
parameters+= [
tkfortkinlast_token.tokensiftk.is_grouportk.ttype==Wildcard
]
returnparameters#token.get_parameters()defget_parameters(self):
"""Return a list of parameters."""parenthesis=self.token_next_by(i=Parenthesis)[1]
result= []
fortokeninparenthesis.tokens:
ifisinstance(token, IdentifierList):
returntoken.get_identifiers()
elifimt(token, i=(Function, Identifier, TypedLiteral),
t=T.Literal):
result.append(token)
returnresult#当满足条件时,调用sqlparse .get_identifiers()返回生成器, parameters += [# tk for tk in last_token.tokens if tk.is_group or tk.ttype == Wildcard ]#if isinstance(token, IdentifierList):# return token.get_identifiers()
TypeError: unsupported operand type(s) for +=: 'generator' and 'list'
elif Web UI (Web User Interface): provide the lineage graph which could be downloaded from the page, or screenshots if there're components other than the lineage graph that's related to this bug.
else: whatever other ways to reproduce this bug.
Expected behavior
A clear and concise description of what you expected to happen, and the output in accordance with the To Reproduce section.
Python version (available via python --version)
3.8.17
3.9.18
3.10.13
3.11.5
etc.
SQLLineage version (available via sqllineage --version):
1.3.8
1.4.7
etc.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
I can't reproduce the issue without the SQL provided. Please desensitize the sensitive information from the SQL and provide a minimum example for debugging.
Also please communicate in English (中英双语也可以) and create a new issue once you have a minimum example.
Describe the bug
tk for tk in last_token.tokens if tk.is_group or tk.ttype == Wildcard
]
报错 TypeError: unsupported operand type(s) for +=: 'generator' and 'list'
SQL
Paste the SQL text here. For example:
To Reproduce
Note here we refer to SQL provided in prior step as stored in a file named
test.sql
if
CLI (Command Line Interface): provide the command you're calling and the output.For example:
elif
API (Application Programming Interface): provide the python code you're using and the output.For example:
elif
Web UI (Web User Interface): provide the lineage graph which could be downloaded from the page, or screenshots if there're components other than the lineage graph that's related to this bug.else
: whatever other ways to reproduce this bug.Expected behavior
A clear and concise description of what you expected to happen, and the output in accordance with the
To Reproduce
section.Python version (available via
python --version
)SQLLineage version (available via
sqllineage --version
):Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: