adding debug.py

This commit is contained in:
2021-09-25 16:47:08 +01:00
parent 47a4ac4bc3
commit 214ce77d8f

View File

@@ -0,0 +1,24 @@
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