holdenk / spark-upgrade

Magic to help Spark pipelines upgrade
Apache License 2.0
33 stars 15 forks source link

Fix Rule L0005 (cast on approx funcs) to not recurse forever. #144

Closed holdenk closed 7 months ago

holdenk commented 8 months ago

The aprox func cast rule was recursing forever now that's been enabled. This checks now for both the original SQLFluff token and the inserted token since the type doesn't match so L5 would just keep trying to add more casts without the change.

CC @bmorck who wrote the code to double check I didn't break anything with this change

Tests: existing tests now pass (on my machine and hopefully CI but give it a minute).

sweep-ai[bot] commented 8 months ago
Sweeping Fixing PR: track the progress here.

I'm currently fixing this PR to address the following:

[Sweep GHA Fix] The GitHub Actions run failed with the following error logs: ``` The command: Run cd sql; flake8 --max-line-length 100 --ignore=E129,W504 yielded the following error: ##[error]Process completed with exit code 1. Here are the logs: ./src/sparksql_upgrade/rules.py:467:24: F821 undefined name 'expression' ```

Created Pull Request: https://github.com/holdenk/spark-upgrade/pull/145