Class: AWSCDK::DataBrew::CfnRuleset::RuleProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
data_brew/cfn_ruleset.rb

Overview

Represents a single data quality requirement that should be validated in the scope of this dataset.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(check_expression:, name:, column_selectors: nil, disabled: nil, substitution_map: nil, threshold: nil) ⇒ RuleProperty

Returns a new instance of RuleProperty.

Parameters:



604
605
606
607
608
609
610
611
612
613
614
615
616
617
# File 'data_brew/cfn_ruleset.rb', line 604

def initialize(check_expression:, name:, column_selectors: nil, disabled: nil, substitution_map: nil, threshold: nil)
  @check_expression = check_expression
  Jsii::Type.check_type(@check_expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "checkExpression")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @column_selectors = column_selectors
  Jsii::Type.check_type(@column_selectors, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZGF0YWJyZXcuQ2ZuUnVsZXNldC5Db2x1bW5TZWxlY3RvclByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "columnSelectors") unless @column_selectors.nil?
  @disabled = disabled
  Jsii::Type.check_type(@disabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "disabled") unless @disabled.nil?
  @substitution_map = substitution_map
  Jsii::Type.check_type(@substitution_map, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZGF0YWJyZXcuQ2ZuUnVsZXNldC5TdWJzdGl0dXRpb25WYWx1ZVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "substitutionMap") unless @substitution_map.nil?
  @threshold = threshold.is_a?(Hash) ? ::AWSCDK::DataBrew::CfnRuleset::ThresholdProperty.new(**threshold.transform_keys(&:to_sym)) : threshold
  Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19kYXRhYnJldy5DZm5SdWxlc2V0LlRocmVzaG9sZFByb3BlcnR5In1dfX0=")), "threshold") unless @threshold.nil?
end

Instance Attribute Details

#check_expressionString (readonly)

The expression which includes column references, condition names followed by variable references, possibly grouped and combined with other conditions.

For example, (:col1 starts_with :prefix1 or :col1 starts_with :prefix2) and (:col1 ends_with :suffix1 or :col1 ends_with :suffix2) . Column and value references are substitution variables that should start with the ':' symbol. Depending on the context, substitution variables' values can be either an actual value or a column name. These values are defined in the SubstitutionMap. If a CheckExpression starts with a column reference, then ColumnSelectors in the rule should be null. If ColumnSelectors has been defined, then there should be no columnn reference in the left side of a condition, for example, is_between :val1 and :val2 .



625
626
627
# File 'data_brew/cfn_ruleset.rb', line 625

def check_expression
  @check_expression
end

#column_selectorsAWSCDK::IResolvable, ... (readonly)

List of column selectors.

Selectors can be used to select columns using a name or regular expression from the dataset. Rule will be applied to selected columns.



637
638
639
# File 'data_brew/cfn_ruleset.rb', line 637

def column_selectors
  @column_selectors
end

#disabledBoolean, ... (readonly)

A value that specifies whether the rule is disabled.

Once a rule is disabled, a profile job will not validate it during a job run. Default value is false.



644
645
646
# File 'data_brew/cfn_ruleset.rb', line 644

def disabled
  @disabled
end

#nameString (readonly)

The name of the rule.



630
631
632
# File 'data_brew/cfn_ruleset.rb', line 630

def name
  @name
end

#substitution_mapAWSCDK::IResolvable, ... (readonly)

The map of substitution variable names to their values used in a check expression.

Variable names should start with a ':' (colon). Variable values can either be actual values or column names. To differentiate between the two, column names should be enclosed in backticks, for example, ":col1": "Column A".



651
652
653
# File 'data_brew/cfn_ruleset.rb', line 651

def substitution_map
  @substitution_map
end

#thresholdAWSCDK::IResolvable, ... (readonly)

The threshold used with a non-aggregate check expression.

Non-aggregate check expressions will be applied to each row in a specific column, and the threshold will be used to determine whether the validation succeeds.



658
659
660
# File 'data_brew/cfn_ruleset.rb', line 658

def threshold
  @threshold
end

Class Method Details

.jsii_propertiesObject



660
661
662
663
664
665
666
667
668
669
# File 'data_brew/cfn_ruleset.rb', line 660

def self.jsii_properties
  {
    :check_expression => "checkExpression",
    :name => "name",
    :column_selectors => "columnSelectors",
    :disabled => "disabled",
    :substitution_map => "substitutionMap",
    :threshold => "threshold",
  }
end

Instance Method Details

#to_jsiiObject



671
672
673
674
675
676
677
678
679
680
681
682
# File 'data_brew/cfn_ruleset.rb', line 671

def to_jsii
  result = {}
  result.merge!({
    "checkExpression" => @check_expression,
    "name" => @name,
    "columnSelectors" => @column_selectors,
    "disabled" => @disabled,
    "substitutionMap" => @substitution_map,
    "threshold" => @threshold,
  })
  result.compact
end