Files
street_group_tech_test/analyse_properties/debug.py
2021-09-25 16:47:08 +01:00

25 lines
559 B
Python

import apache_beam as beam
class DebugShowEmptyColumn(beam.DoFn):
def __init__(self, index):
self.index = index
def process(self, element):
column = element[self.index]
if len(column) == 0:
yield element
return None
class DebugShowColumnWithValueIn(beam.DoFn):
def __init__(self, index, value):
self.index = index
self.value = value
def process(self, element):
column = element[self.index]
if self.value in column:
yield element
return None