Ejemplo n.º 1
0
 def testEnableCache(self):
     statistics_artifact = standard_artifacts.ExampleStatistics()
     statistics_artifact.split_names = artifact_utils.encode_split_names(
         ['eval'])
     example_validator_1 = component.ExampleValidator(
         statistics=channel_utils.as_channel([statistics_artifact]),
         schema=channel_utils.as_channel([standard_artifacts.Schema()]),
     )
     self.assertEqual(None, example_validator_1.enable_cache)
     example_validator_2 = component.ExampleValidator(
         statistics=channel_utils.as_channel([statistics_artifact]),
         schema=channel_utils.as_channel([standard_artifacts.Schema()]),
         enable_cache=True)
     self.assertEqual(True, example_validator_2.enable_cache)
Ejemplo n.º 2
0
 def testConstruct(self):
   example_validator = component.ExampleValidator(
       stats=channel_utils.as_channel(
           [standard_artifacts.ExampleStatistics(split='eval')]),
       schema=channel_utils.as_channel([standard_artifacts.Schema()]),
   )
   self.assertEqual('ExampleValidationPath',
                    example_validator.outputs['output'].type_name)
Ejemplo n.º 3
0
 def testConstruct(self):
   example_validator = component.ExampleValidator(
       statistics=channel_utils.as_channel(
           [standard_artifacts.ExampleStatistics(split='eval')]),
       schema=channel_utils.as_channel([standard_artifacts.Schema()]),
   )
   self.assertEqual(standard_artifacts.ExampleAnomalies.TYPE_NAME,
                    example_validator.outputs['anomalies'].type_name)
Ejemplo n.º 4
0
 def test_construct(self):
     example_vadalitor = component.ExampleValidator(
         stats=channel.as_channel([
             types.TfxType(type_name='ExampleStatisticsPath', split='eval')
         ]),
         schema=channel.as_channel([types.TfxType(type_name='SchemaPath')]),
     )
     self.assertEqual('ExampleValidationPath',
                      example_vadalitor.outputs.output.type_name)
Ejemplo n.º 5
0
 def testConstruct(self):
     statistics_artifact = standard_artifacts.ExampleStatistics()
     statistics_artifact.split_names = artifact_utils.encode_split_names(
         ['eval'])
     example_validator = component.ExampleValidator(
         statistics=channel_utils.as_channel([statistics_artifact]),
         schema=channel_utils.as_channel([standard_artifacts.Schema()]),
     )
     self.assertEqual(standard_artifacts.ExampleAnomalies.TYPE_NAME,
                      example_validator.outputs['anomalies'].type_name)
Ejemplo n.º 6
0
 def testConstruct(self):
   statistics_artifact = standard_artifacts.ExampleStatistics()
   statistics_artifact.split_names = artifact_utils.encode_split_names(
       ['train', 'eval'])
   exclude_splits = ['eval']
   example_validator = component.ExampleValidator(
       statistics=channel_utils.as_channel([statistics_artifact]),
       schema=channel_utils.as_channel([standard_artifacts.Schema()]),
       exclude_splits=exclude_splits)
   self.assertEqual(standard_artifacts.ExampleAnomalies.TYPE_NAME,
                    example_validator.outputs['anomalies'].type_name)
   self.assertEqual(example_validator.spec.exec_properties['exclude_splits'],
                    '["eval"]')
class ExampleValidatorRunner(TfxComponentRunner):

  def __init__(self, args):
    component = example_validator_component.ExampleValidator(
        channel.Channel('ExampleStatisticsPath'), channel.Channel('SchemaPath'))
Ejemplo n.º 8
0
    def __init__(self, stats: str, schema: str):
        component = example_validator_component.ExampleValidator(
            channel.Channel('ExampleStatisticsPath'),
            channel.Channel('SchemaPath'))

        super().__init__(component, {"stats": stats, "schema": schema})