-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RowLevelFilterTreatement trait and object to determine how filter…
…ed rows will be labeled (default True)
- Loading branch information
Showing
11 changed files
with
178 additions
and
44 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
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
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
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
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
32 changes: 32 additions & 0 deletions
32
src/main/scala/com/amazon/deequ/utilities/RowLevelFilterTreatement.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.amazon.deequ.utilities | ||
import com.amazon.deequ.utilities.FilteredRow.FilteredRow | ||
|
||
/** | ||
* Trait that defines how row level results will be treated when a filter is applied to an analyzer | ||
*/ | ||
trait RowLevelFilterTreatment { | ||
def rowLevelFilterTreatment: FilteredRow | ||
} | ||
|
||
/** | ||
* Companion object for RowLevelFilterTreatment | ||
* Defines a sharedInstance that can be used throughout the VerificationRunBuilder | ||
*/ | ||
object RowLevelFilterTreatment { | ||
private var _sharedInstance: RowLevelFilterTreatment = new RowLevelFilterTreatmentImpl(FilteredRow.TRUE) | ||
|
||
def sharedInstance: RowLevelFilterTreatment = _sharedInstance | ||
|
||
def setSharedInstance(instance: RowLevelFilterTreatment): Unit = { | ||
_sharedInstance = instance | ||
} | ||
} | ||
|
||
class RowLevelFilterTreatmentImpl(initialFilterTreatment: FilteredRow) extends RowLevelFilterTreatment { | ||
override val rowLevelFilterTreatment: FilteredRow = initialFilterTreatment | ||
} | ||
|
||
object FilteredRow extends Enumeration { | ||
type FilteredRow = Value | ||
val NULL, TRUE = Value | ||
} |
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
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
Oops, something went wrong.