mirror of
https://github.com/dtomlinson91/street_group_tech_test
synced 2025-12-22 03:55:43 +00:00
adding debug.py
This commit is contained in:
24
analyse_properties/debug.py
Normal file
24
analyse_properties/debug.py
Normal 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
|
||||||
Reference in New Issue
Block a user