Maybe somebody can help me :slightly_smiling_face:...
# ingestion
b
Maybe somebody can help me 🙂 I am trying to ingest a notebook entity. When i ingest a notebook entity over the python emitter, i get a key error. Propably a miss to ingest somekind of key..?:
Copy code
react-dom.production.min.js:216 Error: Unrecognized key NOTEBOOK provided in map {}
    at Gt (EntityRegistry.tsx:11:11)
    at e.value (EntityRegistry.tsx:153:24)
    at renderItem (EntityNameList.tsx:118:53)
    at index.js:143:12
    at index.js:243:14
    at Array.map (<anonymous>)
    at A (index.js:242:33)
    at ai (react-dom.production.min.js:157:137)
    at Xc (react-dom.production.min.js:267:460)
    at _s (react-dom.production.min.js:250:347)
here is the data i ingest: #Datahub Emitter
Copy code
emitter: DatahubRestEmitter = DatahubRestEmitter(gms_server=DATAHUB_SERVER, extra_headers={},)# token=DATAHUB_API_KEY)
    emitter.test_connection()
    
    #milliseconds since epoch
    now: int = int(time.time() * 1000)
    current_timestamp: AuditStampClass = AuditStampClass(time=now, actor="urn:li:corpuser:ingestion")
    
    last_modified = ChangeAuditStampsClass(current_timestamp)    
    
    inputs_notebook: List[NotebookCellClass] = [
        NotebookCellClass(
            type=NotebookCellTypeClass().CHART_CELL,
            chartCell=ChartCellClass(
                cellId="2",
                changeAuditStamps=last_modified,
                cellTitle="second",
            ),
            
        )
    ]
    
    properties: dict[str,str] = {}
    properties = {
        '..': '..'
    }
    
    notebook_info: NotebookInfoClass = NotebookInfoClass(
        title="Janatka Notebook",
        changeAuditStamps=last_modified,
        customProperties=properties,
        externalUrl="",
    )
    
    browse_path: BrowsePathsClass = BrowsePathsClass(
        ["/test/notebook/test/querybook"]
    )
    
    #notebook_key: NotebookKeyClass = NotebookKeyClass(
    #    notebookTool="Zeppelin",
    #    notebookId="Janatka_Test"
    #)
    
    notebook_urn = "urn:li:notebook:(querybook,1234)"

    #Construct a MetadataChangeProposalWrapper object with the Notebook aspects.
        
    notebook_info_mce = MetadataChangeProposalWrapper(
        entityType="notebook",
        changeType=ChangeTypeClass.UPSERT,
        entityUrn=notebook_urn,
        aspectName="notebookInfo",
        aspect=notebook_info,
    )
    
    notebook_content_mce = MetadataChangeProposalWrapper(
        entityType="notebook",
        changeType=ChangeTypeClass.UPSERT,
        entityUrn=notebook_urn,
        aspectName="notebookContent",
        aspect=NotebookContentClass(inputs_notebook),
    )
    
    notebook_path_mce = MetadataChangeProposalWrapper(
        entityType="notebook",
        changeType=ChangeTypeClass.UPSERT,
        entityUrn=notebook_urn,
        aspectName="browsePaths",
        aspect=browse_path,
    )
    
    #Emit metadata!
    emitter.emit(notebook_info_mce)
    emitter.emit(notebook_content_mce)
    emitter.emit(notebook_path_mce)
h
Hi @brainy-intern-50400, could you try running the
validate()
method on each of the mcpws before emitting them and see if there are any errors? Eg:
notebook_info_mce.validate()
b
i will try!
b
Hi there! It seems like Notebook is still an incubating entity and is not formally supported in the UI yet. The UI does not yet "know" about this entity- https://github.com/datahub-project/datahub/blob/master/datahub-web-react/src/App.tsx#L83