Skip to content

Commit

Permalink
Use Union type to make earlier python versions happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterallenwebb committed Jan 23, 2024
1 parent 3a96528 commit 7c3d207
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dbt_common/clients/_jinja_blocks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from collections import namedtuple
from typing import Iterator, Optional, List, Set
from typing import Iterator, List, Optional, Set, Union

from dbt_common.exceptions import (
BlockDefinitionNotAtTopError,
Expand Down Expand Up @@ -295,7 +295,7 @@ def is_current_end(self, tag: Tag) -> bool:

def find_blocks(
self, allowed_blocks: Optional[Set[str]] = None, collect_raw_data: bool = True
) -> Iterator[BlockData | BlockTag]:
) -> Iterator[Union[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 @@ -348,5 +348,5 @@ def find_blocks(

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

0 comments on commit 7c3d207

Please sign in to comment.