Skip to content

Conversation

@martin-g
Copy link
Member

What changes were proposed in this pull request?

Replace symbols like 'abc and Symbol("abc") (where possible) with the more verbose $"abc" in the test code.

Why are the changes needed?

This is a follow-up of #35560

Building with Scala 2.13 produces a lot of warnings like the following ones:

[warn] /home/runner/work/spark/spark/sql/core/src/test/scala/org/apache/spark/sql/execution/BaseScriptTransformationSuite.scala:562:11: [deprecation @  | origin= | version=2.13.0] symbol literal is deprecated; use Symbol("d") instead
[warn]           'd.cast("string"),
[warn]           ^
[warn] /home/runner/work/spark/spark/sql/core/src/test/scala/org/apache/spark/sql/execution/BaseScriptTransformationSuite.scala:563:11: [deprecation @  | origin= | version=2.13.0] symbol literal is deprecated; use Symbol("e") instead
[warn]           'e.cast("string")).collect())

This should make it easier to upgrade to Scala 3 later.

Does this PR introduce any user-facing change?

No! The PR touches only test classes!

How was this patch tested?

The build at CI must be green!

@srowen
Copy link
Member

srowen commented Mar 25, 2022

Thanks @martin-g ! this is larger than the original change, so is it safe to assume that this implements 'foo -> $"foo" basically everywhere in tests?

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@martin-g
Copy link
Member Author

basically everywhere in tests?

This PR also changes Symbol("foo") to `$"foo", where possible.

There are more tests which still use 'foo. Should I add them to this PR or leave them for another follow-up ?

…tests

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
(cherry picked from commit a7551b8)
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
(cherry picked from commit 1fd14242f9b8068ab380f3f290f406e8993eeb9a)
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did skim all of it (wow, big change) and there are maybe a few things we need to fix, but mostly looking good

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Copied-from: #36029

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
@martin-g martin-g marked this pull request as ready for review March 31, 2022 20:39
@martin-g
Copy link
Member Author

@srowen @HeartSaVioR @awdavidson I think the PR is ready for review now!

@srowen
Copy link
Member

srowen commented Mar 31, 2022

It's looking OK, let's check tests. I'm slightly uneasy because it's hard to review every line of change, though I think we've skimmed them all. Do you feel pretty good that there aren't other typos?

@awdavidson
Copy link
Contributor

I echo @srowen pretty big change but generally looking ok. Let’s address test failure

Not to increase the scope of this change but a follow up could be to add a scalastyle check warning against the use of ‘foo declaration mainly to avoid it being reintroduced going forward?

@martin-g
Copy link
Member Author

martin-g commented Apr 1, 2022

Do you feel pretty good that there aren't other typos?

I've checked all changes and they look OK to me !

The last test failure was because $"foo bar" is not supported. It should stay Symbol("foo bar").

@srowen srowen closed this in a139ede Apr 2, 2022
@srowen
Copy link
Member

srowen commented Apr 2, 2022

Merged to master

@martin-g
Copy link
Member Author

martin-g commented Apr 2, 2022

Thank you for your help, @srowen !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants