@@ -4155,15 +4155,15 @@ def _create_evaluation_model_annotation(
41554155 if execution_stats :
41564156 rows_processed = execution_stats .total_rows_processed
41574157 execution_stats_str += (
4158- f"{ _abbreviate_integer_count (rows_processed )} row{ 's' if rows_processed > 1 else '' } "
4159- if rows_processed
4158+ f"{ _abbreviate_integer_count (rows_processed )} row{ 's' if rows_processed != 1 else '' } "
4159+ if rows_processed is not None and rows_processed >= 0
41604160 else ""
41614161 )
41624162
41634163 bytes_processed = execution_stats .total_bytes_processed
41644164 execution_stats_str += (
41654165 f"{ ', ' if execution_stats_str else '' } { _format_bytes (bytes_processed )} "
4166- if bytes_processed
4166+ if bytes_processed is not None and bytes_processed >= 0
41674167 else ""
41684168 )
41694169 execution_stats_str = f" ({ execution_stats_str } )" if execution_stats_str else ""
@@ -4272,7 +4272,7 @@ def _calculate_annotation_str_len(
42724272# Convert number of bytes to a human-readable string
42734273# https://github.com/dbt-labs/dbt-adapters/blob/34fd178539dcb6f82e18e738adc03de7784c032f/dbt-bigquery/src/dbt/adapters/bigquery/connections.py#L165
42744274def _format_bytes (num_bytes : t .Optional [int ]) -> str :
4275- if num_bytes and num_bytes >= 0 :
4275+ if num_bytes is not None and num_bytes >= 0 :
42764276 if num_bytes < 1024 :
42774277 return f"{ num_bytes } bytes"
42784278
@@ -4290,7 +4290,7 @@ def _format_bytes(num_bytes: t.Optional[int]) -> str:
42904290# Abbreviate integer count. Example: 1,000,000,000 -> 1b
42914291# https://github.com/dbt-labs/dbt-adapters/blob/34fd178539dcb6f82e18e738adc03de7784c032f/dbt-bigquery/src/dbt/adapters/bigquery/connections.py#L178
42924292def _abbreviate_integer_count (count : t .Optional [int ]) -> str :
4293- if count and count >= 0 :
4293+ if count is not None and count >= 0 :
42944294 if count < 1000 :
42954295 return str (count )
42964296
0 commit comments