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
Not sure if this is an sqlglot bug or truely an ibis bug - but either ways would need a fix in ibis code or dependency on a certain version of sqlglot. The error AttributeError: 'NoneType' object has no attribute 'pop' is coming from deep inside sqlglot's add_within_group_for_percentiles function.
Error
Traceback (most recent call last):
File "/Users/xyz/abc/abc_ds/trial/tests_trial/sanity/ibis/test_ibis_sanity.py", line 129, in test_sanity_snowflake
.to_pandas()
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/ibis/expr/types/relations.py", line 3332, in to_pandas
return self.execute(**kwargs)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/ibis/expr/types/core.py", line 359, in execute
return self._find_backend(use_default=True).execute(
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/ibis/backends/sql/__init__.py", line 242, in execute
sql = self.compile(table, params=params, limit=limit, **kwargs)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/ibis/backends/sql/__init__.py", line 127, in compile
sql = query.sql(dialect=self.dialect, pretty=pretty, copy=False)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/expressions.py", line 561, in sql
return Dialect.get_or_raise(dialect).generate(self, **opts)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/dialects/dialect.py", line 498, in generate
return self.generator(**opts).generate(expression, copy=copy)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/generator.py", line 583, in generate
sql = self.sql(expression).strip()
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/generator.py", line 734, in sql
sql = transform(self, expression)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/transforms.py", line 601, in _to_sql
return _sql_handler(expression)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/generator.py", line 2199, in select_sql
expressions = self.expressions(expression)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/generator.py", line 3229, in expressions
sql = self.sql(e, comment=False)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/generator.py", line 739, in sql
sql = getattr(self, exp_handler_name)(expression)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/generator.py", line 2725, in alias_sql
return f"{self.sql(expression, 'this')}{alias}"
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/generator.py", line 728, in sql
return self.sql(value)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/generator.py", line 734, in sql
sql = transform(self, expression)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/transforms.py", line 595, in _to_sql
expression = transforms[0](expression)
File "/Users/xyz/opt/anaconda3/envs/trial_env/lib/python3.10/site-packages/sqlglot/transforms.py", line 329, in add_within_group_for_percentiles
column = expression.this.pop()
AttributeError: 'NoneType' object has no attribute 'pop'
Snippet that cuased the error
# Using the following import to avoid confusion with ignore variables (`_`)
from ibis import _ as c
Hey @yazad3! Thanks for reporting this!
I can reproduce the issue and I've got a proximate cause identified, just working on tracking down a simpler reproducer and then we should be able to push up a fix.
What happened?
Context
Not sure if this is an
sqlglot
bug or truely anibis
bug - but either ways would need a fix in ibis code or dependency on a certain version ofsqlglot
. The errorAttributeError: 'NoneType' object has no attribute 'pop'
is coming from deep inside sqlglot'sadd_within_group_for_percentiles
function.Error
Snippet that cuased the error
Environment Information
Python
Installed requirements
What version of ibis are you using?
latest dev veriosn -
9.0.0.dev511
What backend(s) are you using, if any?
Snowflake
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: