Snowflake-Labs / schemachange

A Database Change Management tool for Snowflake
Apache License 2.0
517 stars 228 forks source link

Default warehouse ignored #233

Open fmuntean opened 9 months ago

fmuntean commented 9 months ago

Describe the bug Seems that the passed default Warehouse parameter gets ignored.

snowflake.connector.errors.ProgrammingError: 000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.

The DEPLOY_WH exists in the account.

To Reproduce Using default role DEPLOY_ROLE Using default warehouse DEPLOY_WH Using default database DEMO_DBschema None Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.8.18/x64/bin/schemachange", line 8, in sys.exit(main()) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 896, in main deploy_command(config) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 506, in deploy_command change_history_metadata = session.fetch_change_history_metadata(change_history_table) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 372, in fetch_change_history_metadata results = self.execute_snowflake_query(query) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 367, in execute_snowflake_query raise e File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/schemachange/cli.py", line 360, in execute_snowflake_query res = self.con.execute_string(query) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/snowflake/connector/connection.py", line 833, in execute_string ret = list(stream_generator) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/snowflake/connector/connection.py", line 851, in execute_stream cur.execute(sql, _is_put_get=is_put_or_get, **kwargs) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/snowflake/connector/cursor.py", line 1136, in execute Error.errorhandler_wrapper(self.connection, self, error_class, errvalue) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/snowflake/connector/errors.py", line 290, in errorhandler_wrapper handed_over = Error.hand_to_other_handler( File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/snowflake/connector/errors.py", line 345, in hand_to_other_handler cursor.errorhandler(connection, cursor, error_class, error_value) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/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.

Expected behavior I should not need to specify Warehouse inside the script

dataalias commented 9 months ago

This is the same behavior for the ticket I entered: https://github.com/Snowflake-Labs/schemachange/issues/224