Class: Google::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRule

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/dataplex_v1/classes.rb,
lib/google/apis/dataplex_v1/representations.rb,
lib/google/apis/dataplex_v1/representations.rb

Overview

A rule captures data quality intent about a data source.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDataplexV1DataQualityRule

Returns a new instance of GoogleCloudDataplexV1DataQualityRule.



1365
1366
1367
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1365

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#columnString

Optional. The unnested column which this rule is evaluated against. Corresponds to the JSON property column

Returns:

  • (String)


1297
1298
1299
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1297

def column
  @column
end

#dimensionString

Required. The dimension a rule belongs to. Results are also aggregated at the dimension-level. Supported dimensions are "COMPLETENESS", "ACCURACY", " CONSISTENCY", "VALIDITY", "UNIQUENESS", "INTEGRITY" Corresponds to the JSON property dimension

Returns:

  • (String)


1304
1305
1306
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1304

def dimension
  @dimension
end

#ignore_nullBoolean Also known as: ignore_null?

Optional. Rows with null values will automatically fail a rule, unless ignore_null is true. In that case, such null rows are trivially considered passing. Only applicable to ColumnMap rules. Corresponds to the JSON property ignoreNull

Returns:

  • (Boolean)


1311
1312
1313
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1311

def ignore_null
  @ignore_null
end

#non_null_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleNonNullExpectation

Evaluates whether each column value is null. Corresponds to the JSON property nonNullExpectation



1317
1318
1319
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1317

def non_null_expectation
  @non_null_expectation
end

#range_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRangeExpectation

Evaluates whether each column value lies between a specified range. Corresponds to the JSON property rangeExpectation



1322
1323
1324
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1322

def range_expectation
  @range_expectation
end

#regex_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRegexExpectation

Evaluates whether each column value matches a specified regex. Corresponds to the JSON property regexExpectation



1327
1328
1329
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1327

def regex_expectation
  @regex_expectation
end

#row_condition_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleRowConditionExpectation

Evaluates whether each row passes the specified condition. The SQL expression needs to use BigQuery standard SQL syntax and should produce a boolean per row as the result. Example: col1 >= 0 AND col2 < 10 Corresponds to the JSON property rowConditionExpectation



1334
1335
1336
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1334

def row_condition_expectation
  @row_condition_expectation
end

#set_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleSetExpectation

Evaluates whether each column value is contained by a specified set. Corresponds to the JSON property setExpectation



1339
1340
1341
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1339

def set_expectation
  @set_expectation
end

#statistic_range_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleStatisticRangeExpectation

Evaluates whether the column aggregate statistic lies between a specified range. Corresponds to the JSON property statisticRangeExpectation



1345
1346
1347
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1345

def statistic_range_expectation
  @statistic_range_expectation
end

#table_condition_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleTableConditionExpectation

Evaluates whether the provided expression is true. The SQL expression needs to use BigQuery standard SQL syntax and should produce a scalar boolean result. Example: MIN(col1) >= 0 Corresponds to the JSON property tableConditionExpectation



1352
1353
1354
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1352

def table_condition_expectation
  @table_condition_expectation
end

#thresholdFloat

Optional. The minimum ratio of passing_rows / total_rows required to pass this rule, with a range of 0.0, 1.00 indicates default value (i.e. 1.0) Corresponds to the JSON property threshold

Returns:

  • (Float)


1358
1359
1360
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1358

def threshold
  @threshold
end

#uniqueness_expectationGoogle::Apis::DataplexV1::GoogleCloudDataplexV1DataQualityRuleUniquenessExpectation

Evaluates whether the column has duplicates. Corresponds to the JSON property uniquenessExpectation



1363
1364
1365
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1363

def uniqueness_expectation
  @uniqueness_expectation
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
# File 'lib/google/apis/dataplex_v1/classes.rb', line 1370

def update!(**args)
  @column = args[:column] if args.key?(:column)
  @dimension = args[:dimension] if args.key?(:dimension)
  @ignore_null = args[:ignore_null] if args.key?(:ignore_null)
  @non_null_expectation = args[:non_null_expectation] if args.key?(:non_null_expectation)
  @range_expectation = args[:range_expectation] if args.key?(:range_expectation)
  @regex_expectation = args[:regex_expectation] if args.key?(:regex_expectation)
  @row_condition_expectation = args[:row_condition_expectation] if args.key?(:row_condition_expectation)
  @set_expectation = args[:set_expectation] if args.key?(:set_expectation)
  @statistic_range_expectation = args[:statistic_range_expectation] if args.key?(:statistic_range_expectation)
  @table_condition_expectation = args[:table_condition_expectation] if args.key?(:table_condition_expectation)
  @threshold = args[:threshold] if args.key?(:threshold)
  @uniqueness_expectation = args[:uniqueness_expectation] if args.key?(:uniqueness_expectation)
end