CfnRulesetPropsMixin

class aws_cdk.mixins_preview.aws_databrew.mixins.CfnRulesetPropsMixin(props, *, strategy=None)

Bases: Mixin

Specifies a new ruleset that can be used in a profile job to validate the data quality of a dataset.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-ruleset.html

CloudformationResource:

AWS::DataBrew::Ruleset

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_databrew import mixins as databrew_mixins

cfn_ruleset_props_mixin = databrew_mixins.CfnRulesetPropsMixin(databrew_mixins.CfnRulesetMixinProps(
    description="description",
    name="name",
    rules=[databrew_mixins.CfnRulesetPropsMixin.RuleProperty(
        check_expression="checkExpression",
        column_selectors=[databrew_mixins.CfnRulesetPropsMixin.ColumnSelectorProperty(
            name="name",
            regex="regex"
        )],
        disabled=False,
        name="name",
        substitution_map=[databrew_mixins.CfnRulesetPropsMixin.SubstitutionValueProperty(
            value="value",
            value_reference="valueReference"
        )],
        threshold=databrew_mixins.CfnRulesetPropsMixin.ThresholdProperty(
            type="type",
            unit="unit",
            value=123
        )
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    target_arn="targetArn"
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::DataBrew::Ruleset.

Parameters:
  • props (Union[CfnRulesetMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['description', 'name', 'rules', 'tags', 'targetArn']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ColumnSelectorProperty

class CfnRulesetPropsMixin.ColumnSelectorProperty(*, name=None, regex=None)

Bases: object

Selector of a column from a dataset for profile job configuration.

One selector includes either a column name or a regular expression.

Parameters:
  • name (Optional[str]) – The name of a column from a dataset.

  • regex (Optional[str]) – A regular expression for selecting a column from a dataset.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-columnselector.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_databrew import mixins as databrew_mixins

column_selector_property = databrew_mixins.CfnRulesetPropsMixin.ColumnSelectorProperty(
    name="name",
    regex="regex"
)

Attributes

name

The name of a column from a dataset.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-columnselector.html#cfn-databrew-ruleset-columnselector-name

regex

A regular expression for selecting a column from a dataset.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-columnselector.html#cfn-databrew-ruleset-columnselector-regex

RuleProperty

class CfnRulesetPropsMixin.RuleProperty(*, check_expression=None, column_selectors=None, disabled=None, name=None, substitution_map=None, threshold=None)

Bases: object

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

Parameters:
  • check_expression (Optional[str]) – 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 .

  • column_selectors (Union[IResolvable, Sequence[Union[IResolvable, ColumnSelectorProperty, Dict[str, Any]]], None]) – 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.

  • disabled (Union[bool, IResolvable, None]) – 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.

  • name (Optional[str]) – The name of the rule.

  • substitution_map (Union[IResolvable, Sequence[Union[IResolvable, SubstitutionValueProperty, Dict[str, Any]]], None]) – 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”.``

  • threshold (Union[IResolvable, ThresholdProperty, Dict[str, Any], None]) – 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-rule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_databrew import mixins as databrew_mixins

rule_property = databrew_mixins.CfnRulesetPropsMixin.RuleProperty(
    check_expression="checkExpression",
    column_selectors=[databrew_mixins.CfnRulesetPropsMixin.ColumnSelectorProperty(
        name="name",
        regex="regex"
    )],
    disabled=False,
    name="name",
    substitution_map=[databrew_mixins.CfnRulesetPropsMixin.SubstitutionValueProperty(
        value="value",
        value_reference="valueReference"
    )],
    threshold=databrew_mixins.CfnRulesetPropsMixin.ThresholdProperty(
        type="type",
        unit="unit",
        value=123
    )
)

Attributes

check_expression

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-rule.html#cfn-databrew-ruleset-rule-checkexpression

column_selectors

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-rule.html#cfn-databrew-ruleset-rule-columnselectors

disabled

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-rule.html#cfn-databrew-ruleset-rule-disabled

name

The name of the rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-rule.html#cfn-databrew-ruleset-rule-name

substitution_map

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”.``

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-rule.html#cfn-databrew-ruleset-rule-substitutionmap

threshold

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-rule.html#cfn-databrew-ruleset-rule-threshold

SubstitutionValueProperty

class CfnRulesetPropsMixin.SubstitutionValueProperty(*, value=None, value_reference=None)

Bases: object

A key-value pair to associate an expression’s substitution variable names with their values.

Parameters:
  • value (Optional[str]) – Value or column name.

  • value_reference (Optional[str]) – Variable name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-substitutionvalue.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_databrew import mixins as databrew_mixins

substitution_value_property = databrew_mixins.CfnRulesetPropsMixin.SubstitutionValueProperty(
    value="value",
    value_reference="valueReference"
)

Attributes

value

Value or column name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-substitutionvalue.html#cfn-databrew-ruleset-substitutionvalue-value

value_reference

Variable name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-substitutionvalue.html#cfn-databrew-ruleset-substitutionvalue-valuereference

ThresholdProperty

class CfnRulesetPropsMixin.ThresholdProperty(*, type=None, unit=None, value=None)

Bases: object

The threshold used with a non-aggregate check expression.

The non-aggregate check expression will be applied to each row in a specific column. Then the threshold will be used to determine whether the validation succeeds.

Parameters:
  • type (Optional[str]) – The type of a threshold. Used for comparison of an actual count of rows that satisfy the rule to the threshold value.

  • unit (Optional[str]) – Unit of threshold value. Can be either a COUNT or PERCENTAGE of the full sample size used for validation.

  • value (Union[int, float, None]) – The value of a threshold.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-threshold.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_databrew import mixins as databrew_mixins

threshold_property = databrew_mixins.CfnRulesetPropsMixin.ThresholdProperty(
    type="type",
    unit="unit",
    value=123
)

Attributes

type

The type of a threshold.

Used for comparison of an actual count of rows that satisfy the rule to the threshold value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-threshold.html#cfn-databrew-ruleset-threshold-type

unit

Unit of threshold value.

Can be either a COUNT or PERCENTAGE of the full sample size used for validation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-threshold.html#cfn-databrew-ruleset-threshold-unit

value

The value of a threshold.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-ruleset-threshold.html#cfn-databrew-ruleset-threshold-value