schemachange icon indicating copy to clipboard operation
schemachange copied to clipboard

Default Warehouse Not Selected

Open allstream opened this issue 11 months ago • 2 comments

Based on the versions of schemachange I've installed be it 3.6.1, 3.6.0 and 3.5.4 I've received an error when just starting a project: SQL query: SELECT CREATED, LAST_ALTERED FROM METADATA.INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = REPLACE('SCHEMACHANGE','"','') AND TABLE_NAME = replace('CHANGE_HISTORY','"','') Traceback (most recent call last): File "/Users/username/PycharmProjects/snowflake-platform/venv/bin/schemachange", line 8, in <module> sys.exit(main()) ^^^^^^ File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/schemachange/cli.py", line 888, in main deploy_command(config) ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/schemachange/cli.py", line 502, in deploy_command change_history_metadata = session.fetch_change_history_metadata(change_history_table) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/schemachange/cli.py", line 370, in fetch_change_history_metadata results = self.execute_snowflake_query(query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/schemachange/cli.py", line 365, in execute_snowflake_query raise e File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/schemachange/cli.py", line 358, in execute_snowflake_query res = self.con.execute_string(query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/snowflake/connector/connection.py", line 833, in execute_string ret = list(stream_generator) ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/snowflake/connector/connection.py", line 851, in execute_stream cur.execute(sql, _is_put_get=is_put_or_get, **kwargs) File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/snowflake/connector/cursor.py", line 1136, in execute Error.errorhandler_wrapper(self.connection, self, error_class, errvalue) File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/snowflake/connector/errors.py", line 290, in errorhandler_wrapper handed_over = Error.hand_to_other_handler( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/snowflake/connector/errors.py", line 345, in hand_to_other_handler cursor.errorhandler(connection, cursor, error_class, error_value) File "/Users/username/PycharmProjects/snowflake-platform/venv/lib/python3.12/site-packages/snowflake/connector/errors.py", line 221, in default_errorhandler raise error_class( snowflake.connector.errors.ProgrammingError: 000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.

To Reproduce Steps to reproduce the behavior:

  1. Install schema change pip install schemachange
  2. Configure the project
  3. Run the command schemachange --config-folder=/Users/usename/.snowflake/ --create-change-history-table -w initial_warehouse
  4. See error: snowflake.connector.errors.ProgrammingError: 000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.

Expected behavior This should lead to the default change history table to be created and without error.

  • Version: 3.5.4, 3.6.0, 3.6.1, maybe others.

This is cringe for getting started for new users

allstream avatar Mar 05 '24 16:03 allstream