-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve accuracy of FixQuery rule (#5438)
Co-authored-by: Michel Davit <micheld@spotify.com>
- Loading branch information
1 parent
ce2825a
commit 0cc95ac
Showing
3 changed files
with
37 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 13 additions & 6 deletions
19
scalafix/output-0_14/src/main/scala/fix/v0_14_0/FixQuery.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
package fix.v0_14_0 | ||
|
||
import com.spotify.scio.bigquery.types.BigQueryType.{HasQuery, Query} | ||
import com.spotify.scio.bigquery.types.BigQueryType.HasQuery | ||
|
||
object FixQuery { | ||
// Workaround to get 0.14 code to compile (query method has been removed from HasQuery) | ||
trait HasQueryRaw { | ||
def query: String = ??? | ||
} | ||
|
||
val a: HasQuery = ??? | ||
val b: Query[_] = ??? | ||
object HasQueryType extends HasQuery with HasQueryRaw { | ||
override def queryRaw: String = ??? | ||
override def query: String = ??? | ||
} | ||
|
||
object FixQuery { | ||
HasQueryType.queryRaw | ||
|
||
a.queryRaw | ||
b.queryRaw | ||
HasQueryType.queryRaw.format("foo") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters