From e6abd44552d85a03a87181b23ebc065d273394a7 Mon Sep 17 00:00:00 2001 From: Tanya Shemet Date: Fri, 19 May 2023 14:33:52 +0200 Subject: [PATCH] improved error message for unsupported types #7 --- dbt/adapters/upsolver/impl.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/dbt/adapters/upsolver/impl.py b/dbt/adapters/upsolver/impl.py index a0a03f3..785e2e0 100644 --- a/dbt/adapters/upsolver/impl.py +++ b/dbt/adapters/upsolver/impl.py @@ -112,15 +112,18 @@ def require(self, config, key): def get_options(self, source, options_type): - if options_type == 'connection_options': - options = Connection_options[source.lower()] - elif options_type == 'transformation_options': - options = Transformation_options[source.lower()] - elif options_type == 'target_options': - options = Target_options[source.lower()] - else: - options = Copy_options[source.lower()][options_type] - return options + try: + if options_type == 'connection_options': + options = Connection_options[source.lower()] + elif options_type == 'transformation_options': + options = Transformation_options[source.lower()] + elif options_type == 'target_options': + options = Target_options[source.lower()] + else: + options = Copy_options[source.lower()][options_type] + return options + except Exception: + raise dbt.exceptions.ParsingError(f"Undefined option value: {source}") def list_relations_without_caching( self,