Skip to content

Commit

Permalink
Fix formatting for black.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterallenwebb committed Jan 23, 2024
1 parent 49f15a3 commit b9c0c2d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions dbt_common/clients/_jinja_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def __init__(self, contents: str) -> None:


class BlockTag:
def __init__(self, block_type_name: str, block_name: str, contents: Optional[str] = None, full_block: Optional[str] = None) -> None:
def __init__(
self, block_type_name: str, block_name: str, contents: Optional[str] = None, full_block: Optional[str] = None
) -> None:
self.block_type_name = block_type_name
self.block_name = block_name
self.contents = contents
Expand Down Expand Up @@ -142,7 +144,7 @@ def _first_match(self, *patterns) -> Optional[re.Match]: # type: ignore
def _expect_match(self, expected_name: str, *patterns) -> re.Match: # type: ignore
match = self._first_match(*patterns)
if match is None:
raise UnexpectedMacroEOFError(expected_name, self.text[self.pos:])
raise UnexpectedMacroEOFError(expected_name, self.text[self.pos :])
return match

def handle_expr(self, match: re.Match) -> None:
Expand Down Expand Up @@ -291,7 +293,9 @@ def is_current_end(self, tag: Tag) -> bool:
and tag.block_type_name[3:] == self.current.block_type_name
)

def find_blocks(self, allowed_blocks: Optional[set[str]] = None, collect_raw_data: bool = True) -> Iterator[BlockData | BlockTag]:
def find_blocks(
self, allowed_blocks: Optional[set[str]] = None, collect_raw_data: bool = True
) -> Iterator[BlockData | BlockTag]:
"""Find all top-level blocks in the data."""
if allowed_blocks is None:
allowed_blocks = {"snapshot", "macro", "materialization", "docs"}
Expand Down Expand Up @@ -342,5 +346,7 @@ def find_blocks(self, allowed_blocks: Optional[set[str]] = None, collect_raw_dat
if raw_data:
yield BlockData(raw_data)

def lex_for_blocks(self, allowed_blocks: Optional[set[str]] = None, collect_raw_data: bool = True) -> List[BlockData | BlockTag]:
def lex_for_blocks(
self, allowed_blocks: Optional[set[str]] = None, collect_raw_data: bool = True
) -> List[BlockData | BlockTag]:
return list(self.find_blocks(allowed_blocks=allowed_blocks, collect_raw_data=collect_raw_data))

0 comments on commit b9c0c2d

Please sign in to comment.