Skip to content

Let SparkCallMatcher.apply fix inferred values #3695

@JCZuurmond

Description

@JCZuurmond

Is there an existing issue for this?

  • I have searched the existing issues

Problem statement

Let SparkCallMatcher.apply currently only works for constants:

def apply(self, from_table: FromTableSqlLinter, index: TableMigrationIndex, node: Call) -> None:
table_arg = self._get_table_arg(node)
assert isinstance(table_arg, Const)
# TODO locate constant when value is inferred
info = UsedTable.parse(table_arg.value, from_table.schema)
dst = self._find_dest(index, info)
if dst is not None:
table_arg.value = dst.destination()
)

Proposed Solution

Make it work with inferred values. See linked commit for example tests

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions