Class: Rafflesia::DatasetValidateData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/datasets/dataset_validate_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  checked_artifact_count: :checked_artifact_count,
  dataset_name: :dataset_name,
  dataset_version: :dataset_version,
  expected_row_count: :expected_row_count,
  failure_count: :failure_count,
  is_valid: :is_valid,
  issue_count: :issue_count,
  issues: :issues,
  manifest: :manifest,
  manifest_path: :manifest_path,
  manifest_sha256: :manifest_sha_256,
  row_count: :row_count,
  row_count_checked: :row_count_checked,
  selected_tables: :selected_tables,
  source: :source,
  structure_checks: :structure_checks,
  structure_count: :structure_count,
  table_artifact_count: :table_artifact_count,
  table_checks: :table_checks
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ DatasetValidateData

Returns a new instance of DatasetValidateData.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 51

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @checked_artifact_count = hash[:checked_artifact_count]
  @dataset_name = hash[:dataset_name]
  @dataset_version = hash[:dataset_version]
  @expected_row_count = hash[:expected_row_count]
  @failure_count = hash[:failure_count]
  @is_valid = hash[:is_valid]
  @issue_count = hash[:issue_count]
  @issues = (hash[:issues] || []).map { |item| item ? Rafflesia::DatasetValidationIssue.new(item) : nil }
  @manifest = hash[:manifest] ? Rafflesia::DatasetManifest.new(hash[:manifest]) : nil
  @manifest_path = hash[:manifest_path]
  @manifest_sha_256 = hash[:manifest_sha256]
  @row_count = hash[:row_count]
  @row_count_checked = hash[:row_count_checked]
  @selected_tables = (hash[:selected_tables] || [])
  @source = hash[:source]
  @structure_checks = (hash[:structure_checks] || []).map { |item| item ? Rafflesia::DatasetStructureCheck.new(item) : nil }
  @structure_count = hash[:structure_count]
  @table_artifact_count = hash[:table_artifact_count]
  @table_checks = (hash[:table_checks] || []).map { |item| item ? Rafflesia::DatasetTableCheck.new(item) : nil }
end

Instance Attribute Details

#checked_artifact_countObject

Returns the value of attribute checked_artifact_count.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def checked_artifact_count
  @checked_artifact_count
end

#dataset_nameObject

Returns the value of attribute dataset_name.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def dataset_name
  @dataset_name
end

#dataset_versionObject

Returns the value of attribute dataset_version.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def dataset_version
  @dataset_version
end

#expected_row_countObject

Returns the value of attribute expected_row_count.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def expected_row_count
  @expected_row_count
end

#failure_countObject

Returns the value of attribute failure_count.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def failure_count
  @failure_count
end

#is_validObject

Returns the value of attribute is_valid.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def is_valid
  @is_valid
end

#issue_countObject

Returns the value of attribute issue_count.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def issue_count
  @issue_count
end

#issuesObject

Returns the value of attribute issues.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def issues
  @issues
end

#manifestObject

Returns the value of attribute manifest.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def manifest
  @manifest
end

#manifest_pathObject

Returns the value of attribute manifest_path.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def manifest_path
  @manifest_path
end

#manifest_sha_256Object

Returns the value of attribute manifest_sha_256.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def manifest_sha_256
  @manifest_sha_256
end

#row_countObject

Returns the value of attribute row_count.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def row_count
  @row_count
end

#row_count_checkedObject

Returns the value of attribute row_count_checked.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def row_count_checked
  @row_count_checked
end

#selected_tablesObject

Returns the value of attribute selected_tables.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def selected_tables
  @selected_tables
end

#sourceObject

Returns the value of attribute source.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def source
  @source
end

#structure_checksObject

Returns the value of attribute structure_checks.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def structure_checks
  @structure_checks
end

#structure_countObject

Returns the value of attribute structure_count.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def structure_count
  @structure_count
end

#table_artifact_countObject

Returns the value of attribute table_artifact_count.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def table_artifact_count
  @table_artifact_count
end

#table_checksObject

Returns the value of attribute table_checks.



30
31
32
# File 'lib/rafflesia/datasets/dataset_validate_data.rb', line 30

def table_checks
  @table_checks
end