File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -8520,19 +8520,21 @@ def expand(
85208520 The transformed expression.
85218521 """
85228522 normalized_sources = {normalize_table_name (k , dialect = dialect ): v for k , v in sources .items ()}
8523- # Create a query provider based on the sources parameter
85248523
85258524 def _expand (node : Expression ):
85268525 if isinstance (node , Table ):
85278526 name = normalize_table_name (node , dialect = dialect )
85288527 source = normalized_sources .get (name )
8528+
85298529 if source :
85308530 # Create a subquery with the same alias (or table name if no alias)
85318531 parsed_source = source () if callable (source ) else source
85328532 subquery = parsed_source .subquery (node .alias or name )
85338533 subquery .comments = [f"source: { name } " ]
8534+
85348535 # Continue expanding within the subquery
85358536 return subquery .transform (_expand , copy = False )
8537+
85368538 return node
85378539
85388540 return expression .transform (_expand , copy = copy )
You can’t perform that action at this time.
0 commit comments