Skip to content
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

bug: Snowflake temp table creation fails if whitespace in any column name #10835

Closed
1 task done
JonaGeishauser opened this issue Feb 13, 2025 · 1 comment · Fixed by #10836
Closed
1 task done

bug: Snowflake temp table creation fails if whitespace in any column name #10835

JonaGeishauser opened this issue Feb 13, 2025 · 1 comment · Fixed by #10836
Labels
bug Incorrect behavior inside of ibis

Comments

@JonaGeishauser
Copy link

What happened?

Creating a temp table on the snowflake backend fails if any column of the passed table data contains a whitespace.

What version of ibis are you using?

9.5.0

What backend(s) are you using, if any?

Snowflake

Relevant log output

Traceback (most recent call last):
  File "/.venv/lib/python3.11/site-packages/ibis/backends/snowflake/__init__.py", line 844, in create_table
    self._run_pre_execute_hooks(table)
  File "/.venv/lib/python3.11/site-packages/ibis/backends/__init__.py", line 1144, in _run_pre_execute_hooks
    self._register_in_memory_tables(expr)
  File "/.venv/lib/python3.11/site-packages/ibis/backends/__init__.py", line 1119, in _register_in_memory_tables
    self._register_in_memory_table(memtable)
  File "/.venv/lib/python3.11/site-packages/ibis/backends/snowflake/__init__.py", line 677, in _register_in_memory_table
    self.read_parquet(path, table_name=name)
  File "/.venv/lib/python3.11/site-packages/ibis/backends/snowflake/__init__.py", line 1161, in read_parquet
    cur.execute(copy_query)
  File "/.venv/lib/python3.11/site-packages/snowflake/connector/cursor.py", line 1097, in execute
    Error.errorhandler_wrapper(self.connection, self, error_class, errvalue)
  File "/.venv/lib/python3.11/site-packages/snowflake/connector/errors.py", line 284, in errorhandler_wrapper
    handed_over = Error.hand_to_other_handler(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11/site-packages/snowflake/connector/errors.py", line 339, in hand_to_other_handler
    cursor.errorhandler(connection, cursor, error_class, error_value)
  File "/.venv/lib/python3.11/site-packages/snowflake/connector/errors.py", line 215, in default_errorhandler
    raise error_class(
snowflake.connector.errors.ProgrammingError: 001851 (22023): Invalid extraction path 'col 1': invalid token at position 4

Code of Conduct

  • I agree to follow this project's Code of Conduct
@JonaGeishauser JonaGeishauser added the bug Incorrect behavior inside of ibis label Feb 13, 2025
@JonaGeishauser
Copy link
Author

Minimal reproduceable code:

self.con = ibis.snowflake.connect(<...>)
testdf2 = pl.DataFrame({"col1": ["I", "like", "spaces"]})
self.con.create_table(name="mytemptable", obj=testdf2, temp=True) # This works

testdf = pl.DataFrame({"col 1": ["I", "like", "spaces"]})
self.con.create_table(name="mytemptable2", obj=testdf, temp=True) # This breaks

@JonaGeishauser JonaGeishauser changed the title bug: bug: Snowflake temp table creation fails if whitespace in any column name Feb 13, 2025
@github-project-automation github-project-automation bot moved this from backlog to done in Ibis planning and roadmap Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis
Projects
Archived in project
1 participant