dbt-snowflake icon indicating copy to clipboard operation
dbt-snowflake copied to clipboard

[ADAP-1036] [Bug] Error handling fails in snowflake when language is not English

Open pei0804 opened this issue 1 year ago • 2 comments

Is this a new bug in dbt-snowflake?

  • [X] I believe this is a new bug in dbt-snowflake
  • [X] I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

In Japanese, Error handling fails at this code.

https://github.com/dbt-labs/dbt-snowflake/blob/6c43ccf63e502d54dd7e2bc0c07458f266e6d0ba/dbt/adapters/snowflake/impl.py#L115-L121

This is Error messages.

Database Error
  002043 (02000): SQLコンパイルエラー:
  オブジェクトは存在しないか、操作を実行できません。

Expected Behavior

Errors can be handled and the process continues.

Steps To Reproduce

  1. Set Snowflake language to Japanese.
alter USER MY_USER set LANGUAGE = 'ja';
  1. dbt compile --select something
06:12:05  Encountered an error:
Database Error
  002043 (02000): SQLコンパイルエラー:
  オブジェクトは存在しないか、操作を実行できません。
make: *** [compile] Error 2

Relevant log output

The schema name and query ID are set to dummy values.


オブジェクトは存在しないか、操作を実行できません。
15:22:15.816929 [debug] [ThreadPool]: Snowflake adapter: Error running SQL: macro list_relations_without_caching
15:22:15.817485 [debug] [ThreadPool]: Snowflake adapter: Rolling back transaction.
15:22:15.818060 [debug] [ThreadPool]: On list_GENERIC_PREP_src_event_data: Close
15:22:15.923507 [debug] [ThreadPool]: Snowflake adapter: Snowflake query id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
15:22:15.924533 [debug] [ThreadPool]: Snowflake adapter: Snowflake error: 002043 (02000): SQLコンパイルエラー:
オブジェクトは存在しないか、操作を実行できません。
15:22:15.925490 [debug] [ThreadPool]: Snowflake adapter: Error running SQL: macro list_relations_without_caching
15:22:15.926177 [debug] [ThreadPool]: Snowflake adapter: Rolling back transaction.
15:22:15.926894 [debug] [ThreadPool]: On list_GENERIC_PROD_project_alpha: Close
15:22:15.936018 [debug] [ThreadPool]: Snowflake adapter: Snowflake query id: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
15:22:15.936818 [debug] [ThreadPool]: Snowflake adapter: Snowflake error: 002043 (02000): SQLコンパイルエラー:
オブジェクトは存在しないか、操作を実行できません。
15:22:15.937702 [debug] [ThreadPool]: Snowflake adapter: Error running SQL: macro list_relations_without_caching
15:22:15.938387 [debug] [ThreadPool]: Snowflake adapter: Rolling back transaction.
15:22:15.939081 [debug] [ThreadPool]: On list_GENERIC_PREP_project_z: Close
15:22:16.008074 [debug] [MainThread]: Connection 'master' was properly closed.
15:22:16.008735 [debug] [MainThread]: Connection 'list_GENERIC_PREP_src_event_data' was properly closed.
15:22:16.009280 [debug] [MainThread]: Connection 'list_GENERIC_PROD_project_alpha' was properly closed.
15:22:16.009819 [debug] [MainThread]: Connection 'list_GENERIC_PROD_project_beta' was properly closed.
15:22:16.010353 [debug] [MainThread]: Connection 'list_GENERIC_PROD_project_gamma' was properly closed.
15:22:16.010887 [debug] [MainThread]: Connection 'list_GENERIC_PROD_project_delta' was properly closed.
15:22:16.011418 [debug] [MainThread]: Connection 'list_GENERIC_PREP_src_project_data' was properly closed.
15:22:16.011956 [debug] [MainThread]: Connection 'list_GENERIC_PREP_dq_project_epsilon_logs' was properly closed.
15:22:16.012490 [debug] [MainThread]: Connection 'list_GENERIC_PREP_dq_project_zeta_logs' was properly closed.
15:22:16.013230 [error] [MainThread]: Encountered an error:
Database Error
  002043 (02000): SQLコンパイルエラー:
  オブジェクトは存在しないか、操作を実行できません。
15:22:16.014218 [debug] [MainThread]: Command `dbt compile` failed at 15:22:16.014047 after 20.98 seconds
15:22:16.014885 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x1034f9f30>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x105b03520>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10e983520>]}
15:22:16.015549 [debug] [MainThread]: Flushing usage events

Environment

macOS Monterey
Python 3.10.5
dbt-core 1.6.1
snowflake 1.6.0

Additional Context

This bug can be fixed by setting the appropriate Japanese for the handling if. And I have ready to contriubute this issue.

pei0804 avatar Nov 18 '23 06:11 pei0804

Thanks for reporting this issue @pei0804 !

This bug can be fixed by setting the appropriate Japanese for the handling if. And I have ready to contriubute this issue.

Do you want to open a pull request for this and tag @dbeatty10 in a comment when it's ready?

dbeatty10 avatar Nov 21 '23 16:11 dbeatty10

I will do it.

pei0804 avatar Nov 22 '23 00:11 pei0804

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

github-actions[bot] avatar Jun 04 '24 01:06 github-actions[bot]

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

github-actions[bot] avatar Jun 11 '24 01:06 github-actions[bot]