mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-18 21:44:03 +00:00
16 lines
443 B
Python
16 lines
443 B
Python
|
|
from gometa.ingestion.api.source import Extractor, WorkUnit
|
||
|
|
from gometa.ingestion.api import RecordEnvelope
|
||
|
|
|
||
|
|
class WorkUnitMCEExtractor(Extractor):
|
||
|
|
"""An extractor that simply returns MCE-s inside workunits back as records"""
|
||
|
|
|
||
|
|
def configure(self, workunit: WorkUnit):
|
||
|
|
self.workunit = workunit
|
||
|
|
|
||
|
|
def get_records(self) -> RecordEnvelope:
|
||
|
|
yield RecordEnvelope(self.workunit.mce, {})
|
||
|
|
|
||
|
|
def close(self):
|
||
|
|
pass
|
||
|
|
|