class_docstr: QualityCheck step for workflow.
class_docstr_tok: ["QualityCheck","step","for","workflow","."]
docstr: Constructs a QualityCheckStep.
  
  Args:
      name (str): The name of the QualityCheckStep step.
      quality_check_config (QualityCheckConfig): A QualityCheckConfig instance.
      check_job_config (CheckJobConfig): A CheckJobConfig instance.
      skip_check (bool or PipelineVariable): Whether the check
          should be skipped (default: False).
      fail_on_violation (bool or PipelineVariable): Whether to fail the step
          if violation detected (default: True).
      register_new_baseline (bool or PipelineVariable): Whether
          the new baseline should be registered (default: False).
      model_package_group_name (str or PipelineVariable): The name of a
          registered model package group, among which the baseline will be fetched
          from the latest approved model (default: None).
      supplied_baseline_statistics (str or PipelineVariable): The S3 path
          to the supplied statistics object representing the statistics JSON file
          which will be used for drift to check (default: None).
      supplied_baseline_constraints (str or PipelineVariable): The S3 path
          to the supplied constraints object representing the constraints JSON file
          which will be used for drift to check (default: None).
      display_name (str): The display name of the QualityCheckStep step (default: None).
      description (str): The description of the QualityCheckStep step (default: None).
      cache_config (CacheConfig):  A `sagemaker.workflow.steps.CacheConfig` instance
          (default: None).
      depends_on (List[Union[str, Step, StepCollection]]): A list of `Step`/`StepCollection`
          names or `Step` instances or `StepCollection` instances that this `QualityCheckStep`
          depends on (default: None).
docstr_tok: ["Constructs","a","QualityCheckStep",".","Args",":","name","(","str",")",":","The","name","of","the","QualityCheckStep","step",".","quality_check_config","(","QualityCheckConfig",")",":","A","QualityCheckConfig","instance",".","check_job_config","(","CheckJobConfig",")",":","A","CheckJobConfig","instance",".","skip_check","(","bool","or","PipelineVariable",")",":","Whether","the","check","should","be","skipped","(","default",":","False",")",".","fail_on_violation","(","bool","or","PipelineVariable",")",":","Whether","to","fail","the","step","if","violation","detected","(","default",":","True",")",".","register_new_baseline","(","bool","or","PipelineVariable",")",":","Whether","the","new","baseline","should","be","registered","(","default",":","False",")",".","model_package_group_name","(","str","or","PipelineVariable",")",":","The","name","of","a","registered","model","package","group",",","among","which","the","baseline","will","be","fetched","from","the","latest","approved","model","(","default",":","None",")",".","supplied_baseline_statistics","(","str","or","PipelineVariable",")",":","The","S3","path","to","the","supplied","statistics","object","representing","the","statistics","JSON","file","which","will","be","used","for","drift","to","check","(","default",":","None",")",".","supplied_baseline_constraints","(","str","or","PipelineVariable",")",":","The","S3","path","to","the","supplied","constraints","object","representing","the","constraints","JSON","file","which","will","be","used","for","drift","to","check","(","default",":","None",")",".","display_name","(","str",")",":","The","display","name","of","the","QualityCheckStep","step","(","default",":","None",")",".","description","(","str",")",":","The","description","of","the","QualityCheckStep","step","(","default",":","None",")",".","cache_config","(","CacheConfig",")",":","A","`","sagemaker.workflow.steps.CacheConfig","`","instance","(","default",":","None",")",".","depends_on","(","List","[","Union","[","str",",","Step",",","StepCollection","]","]",")",":","A","list","of","`","Step","`","\/","`","StepCollection","`","names","or","`","Step","`","instances","or","`","StepCollection","`","instances","that","this","`","QualityCheckStep","`","depends","on","(","default",":","None",")","."]
code: def __init__(
      self,
      name: str,
      quality_check_config: QualityCheckConfig,
      check_job_config: CheckJobConfig,
      skip_check: Union[bool, PipelineVariable] = False,
      fail_on_violation: Union[bool, PipelineVariable] = True,
      register_new_baseline: Union[bool, PipelineVariable] = False,
      model_package_group_name: Union[str, PipelineVariable] = None,
      supplied_baseline_statistics: Union[str, PipelineVariable] = None,
      supplied_baseline_constraints: Union[
          str, PipelineVariable
      ] = None,
      display_name: str = None,
      description: str = None,
      cache_config: CacheConfig = None,
      depends_on: Optional[
          List[Union[str, Step, StepCollection]]
      ] = None,
  ):
      """Constructs a QualityCheckStep.
  
      Args:
          name (str): The name of the QualityCheckStep step.
          quality_check_config (QualityCheckConfig): A QualityCheckConfig instance.
          check_job_config (CheckJobConfig): A CheckJobConfig instance.
          skip_check (bool or PipelineVariable): Whether the check
              should be skipped (default: False).
          fail_on_violation (bool or PipelineVariable): Whether to fail the step
              if violation detected (default: True).
          register_new_baseline (bool or PipelineVariable): Whether
              the new baseline should be registered (default: False).
          model_package_group_name (str or PipelineVariable): The name of a
              registered model package group, among which the baseline will be fetched
              from the latest approved model (default: None).
          supplied_baseline_statistics (str or PipelineVariable): The S3 path
              to the supplied statistics object representing the statistics JSON file
              which will be used for drift to check (default: None).
          supplied_baseline_constraints (str or PipelineVariable): The S3 path
              to the supplied constraints object representing the constraints JSON file
              which will be used for drift to check (default: None).
          display_name (str): The display name of the QualityCheckStep step (default: None).
          description (str): The description of the QualityCheckStep step (default: None).
          cache_config (CacheConfig):  A `sagemaker.workflow.steps.CacheConfig` instance
              (default: None).
          depends_on (List[Union[str, Step, StepCollection]]): A list of `Step`/`StepCollection`
              names or `Step` instances or `StepCollection` instances that this `QualityCheckStep`
              depends on (default: None).
      """
      if not isinstance(
          quality_check_config, DataQualityCheckConfig
      ) and not isinstance(
          quality_check_config, ModelQualityCheckConfig
      ):
          raise RuntimeError(
              "The quality_check_config can only be object of "
              + "DataQualityCheckConfig or ModelQualityCheckConfig"
          )
  
      super(QualityCheckStep, self).__init__(
          name,
          display_name,
          description,
          StepTypeEnum.QUALITY_CHECK,
          depends_on,
      )
      self.skip_check = skip_check
      self.fail_on_violation = fail_on_violation
      self.register_new_baseline = register_new_baseline
      self.check_job_config = check_job_config
      self.quality_check_config = quality_check_config
      self.model_package_group_name = model_package_group_name
      self.supplied_baseline_statistics = supplied_baseline_statistics
      self.supplied_baseline_constraints = supplied_baseline_constraints
      self.cache_config = cache_config
  
      if isinstance(self.quality_check_config, DataQualityCheckConfig):
          self._model_monitor = (
              self.check_job_config._generate_model_monitor(
                  "DefaultModelMonitor"
              )
          )
      else:
          self._model_monitor = (
              self.check_job_config._generate_model_monitor(
                  "ModelQualityMonitor"
              )
          )
      self._model_monitor.latest_baselining_job_name = (
          self._model_monitor._generate_baselining_job_name()
      )
  
      baseline_job_inputs_with_nones = (
          self._generate_baseline_job_inputs()
      )
      self._baseline_job_inputs = [
          baseline_job_input
          for baseline_job_input in baseline_job_inputs_with_nones.values()
          if baseline_job_input is not None
      ]
      self._baseline_output = self._generate_baseline_output()
      self._baselining_processor = self._generate_baseline_processor(
          baseline_dataset_input=baseline_job_inputs_with_nones[
              "baseline_dataset_input"
          ],
          baseline_output=self._baseline_output,
          post_processor_script_input=baseline_job_inputs_with_nones[
              "post_processor_script_input"
          ],
          record_preprocessor_script_input=baseline_job_inputs_with_nones[
              "record_preprocessor_script_input"
          ],
      )
  
      root_prop = Properties(step_name=name, step=self)
      root_prop.__dict__["CalculatedBaselineConstraints"] = Properties(
          step_name=name,
          step=self,
          path="CalculatedBaselineConstraints",
      )
      root_prop.__dict__["CalculatedBaselineStatistics"] = Properties(
          step_name=name, step=self, path="CalculatedBaselineStatistics"
      )
      root_prop.__dict__[
          "BaselineUsedForDriftCheckStatistics"
      ] = Properties(
          step_name=name,
          step=self,
          path="BaselineUsedForDriftCheckStatistics",
      )
      root_prop.__dict__[
          "BaselineUsedForDriftCheckConstraints"
      ] = Properties(
          step_name=name,
          step=self,
          path="BaselineUsedForDriftCheckConstraints",
      )
      self._properties = root_prop
  
imports: from __future__ import absolute_import
  from abc import ABC
  from typing import List, Union, Optional
  import os
  import pathlib
  import attr
  from sagemaker import s3
  from sagemaker.model_monitor import ModelMonitor
  from sagemaker.processing import ProcessingOutput, ProcessingJob, Processor, ProcessingInput
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.workflow.entities import RequestType, PipelineVariable
  from sagemaker.workflow.properties import Properties
  from sagemaker.workflow.step_collections import StepCollection
  from sagemaker.workflow.steps import Step, StepTypeEnum, CacheConfig
  from sagemaker.workflow.check_job_config import CheckJobConfig
  from sagemaker.workflow.utilities import trim_request_dict
label_desc: Use image node_id 1 to create a new QualityCheckStep object from inherited base classes: Step with example: obj = QualityCheckStep(name, quality_check_config, check_job_config, skip_check, fail_on_violation, register_new_baseline, model_package_group_name, supplied_baseline_statistics, supplied_baseline_constraints, display_name, description, cache_config, depends_on)