Skip to content

Commit

Permalink
Fix typing in describe_batch to convince mypy batch_start exists …
Browse files Browse the repository at this point in the history
…when needed
  • Loading branch information
QMalcolm committed Dec 9, 2024
1 parent d1d68c0 commit 82ecba1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/dbt/task/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,13 @@ def describe_node(self) -> str:
return f"{self.node.language} microbatch model {self.get_node_representation()}"

def describe_batch(self) -> str:
if self.batch_idx is None:
batch_start = self.batch_start
if batch_start is None:
return ""

Check warning on line 392 in core/dbt/task/run.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/task/run.py#L390-L392

Added lines #L390 - L392 were not covered by tests

# Only visualize date if batch_start year/month/day
formatted_batch_start = MicrobatchBuilder.format_batch_start(
self.batch_start, self.node.config.batch_size
batch_start, self.node.config.batch_size
)
return f"batch {formatted_batch_start} of {self.get_node_representation()}"

Expand Down

0 comments on commit 82ecba1

Please sign in to comment.