File tree Expand file tree Collapse file tree
dbt-athena/src/dbt/adapters/athena Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545from dbt .adapters .sql import SQLConnectionManager
4646
4747
48+ def _is_positive_int (value : Any ) -> bool :
49+ try :
50+ return int (value ) >= 1
51+ except (TypeError , ValueError ):
52+ return False
53+
54+
4855@dataclass
4956class AthenaAdapterResponse (AdapterResponse ):
5057 data_scanned_in_bytes : Optional [int ] = None
@@ -88,20 +95,13 @@ def __post_init__(self) -> None:
8895 raw = getattr (self , field_name )
8996 if raw is None :
9097 continue
91- if not self . _is_positive_int (raw ):
98+ if not _is_positive_int (raw ):
9299 raise DbtRuntimeError (
93100 f"{ field_name } must be a positive integer (got { raw !r} ). "
94101 "Omit the field to use the default."
95102 )
96103 setattr (self , field_name , int (raw ))
97104
98- @staticmethod
99- def _is_positive_int (value : Any ) -> bool :
100- try :
101- return int (value ) >= 1
102- except (TypeError , ValueError ):
103- return False
104-
105105 @property
106106 def type (self ) -> str :
107107 return "athena"
You can’t perform that action at this time.
0 commit comments