mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-30 20:15:56 +00:00
1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
"use strict";(self.webpackChunkdocs_website=self.webpackChunkdocs_website||[]).push([[38723],{15680:(e,a,t)=>{t.d(a,{xA:()=>m,yg:()=>d});var n=t(96540);function r(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function i(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?i(Object(t),!0).forEach((function(a){r(e,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}))}return e}function o(e,a){if(null==e)return{};var t,n,r=function(e,a){if(null==e)return{};var t,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],a.indexOf(t)>=0||(r[t]=e[t]);return r}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],a.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var c=n.createContext({}),s=function(e){var a=n.useContext(c),t=a;return e&&(t="function"==typeof e?e(a):l(l({},a),e)),t},m=function(e){var a=s(e.components);return n.createElement(c.Provider,{value:a},e.children)},p="mdxType",g={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},y=n.forwardRef((function(e,a){var t=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),p=s(t),y=r,d=p["".concat(c,".").concat(y)]||p[y]||g[y]||i;return t?n.createElement(d,l(l({ref:a},m),{},{components:t})):n.createElement(d,l({ref:a},m))}));function d(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var i=t.length,l=new Array(i);l[0]=y;var o={};for(var c in a)hasOwnProperty.call(a,c)&&(o[c]=a[c]);o.originalType=e,o[p]="string"==typeof e?e:r,l[1]=o;for(var s=2;s<i;s++)l[s]=t[s];return n.createElement.apply(null,l)}return n.createElement.apply(null,t)}y.displayName="MDXCreateElement"},74348:(e,a,t)=>{t.r(a),t.d(a,{assets:()=>m,contentTitle:()=>c,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>p});t(96540);var n=t(15680);function r(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function i(e,a){return a=null!=a?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):function(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})),e}function l(e,a){if(null==e)return{};var t,n,r=function(e,a){if(null==e)return{};var t,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],a.indexOf(t)>=0||(r[t]=e[t]);return r}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],a.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}const o={title:"Kafka Emitter"},c=void 0,s={unversionedId:"python-sdk/clients/kafka-emitter",id:"python-sdk/clients/kafka-emitter",title:"Kafka Emitter",description:"The Kafka emitter can be used to push metadata to DataHub.",source:"@site/genDocs/python-sdk/clients/kafka-emitter.mdx",sourceDirName:"python-sdk/clients",slug:"/python-sdk/clients/kafka-emitter",permalink:"/docs/python-sdk/clients/kafka-emitter",draft:!1,editUrl:"https://github.com/datahub-project/datahub/blob/master/genDocs/python-sdk/clients/kafka-emitter.mdx",tags:[],version:"current",frontMatter:{title:"Kafka Emitter"},sidebar:"overviewSidebar",previous:{title:"Graph Client",permalink:"/docs/python-sdk/clients/graph-client"},next:{title:"Rest Emitter",permalink:"/docs/python-sdk/clients/rest-emitter"}},m={},p=[{value:'<span className="visually-hidden">DatahubKafkaEmitter</span>',id:"datahub.emitter.kafka_emitter.DatahubKafkaEmitter",level:3},{value:"close()",id:"close",level:4},{value:"emit(item, callback=None)",id:"emititem-callbacknone",level:4},{value:"emit_mce_async(mce, callback)",id:"emit_mce_asyncmce-callback",level:4},{value:"emit_mcp_async(mcp, callback)",id:"emit_mcp_asyncmcp-callback",level:4},{value:"flush()",id:"flush",level:4},{value:'<span className="visually-hidden">KafkaEmitterConfig</span>',id:"datahub.emitter.kafka_emitter.KafkaEmitterConfig",level:3},{value:"connection <em>: <code>KafkaProducerConnectionConfig</code></em>",id:"connection--kafkaproducerconnectionconfig",level:4},{value:"model_config <em>: ClassVarConfigDict</em> <em>= {'_schema_extra': <function ConfigModel.Config._schema_extra>, 'extra': 'forbid', 'ignored_types': (<class 'cached_property.cached_property'>,), 'json_schema_extra': <function ConfigModel.Config._schema_extra>}</em>",id:"model_config--classvarconfigdict--_schema_extra-function-configmodelconfig_schema_extra-extra-forbid-ignored_types-class-cached_propertycached_property-json_schema_extra-function-configmodelconfig_schema_extra",level:4},{value:"topic_routes <em>: <code>Dict</code>str, str</em>",id:"topic_routes--dictstr-str",level:4},{value:"<em>classmethod</em> validate_topic_routes(v)",id:"classmethod-validate_topic_routesv",level:4}],g={toc:p},y="wrapper";function d(e){var{components:a}=e,t=l(e,["components"]);return(0,n.yg)(y,i(function(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(a){r(e,a,t[a])}))}return e}({},g,t),{components:a,mdxType:"MDXLayout"}),(0,n.yg)("div",{className:"sphinx-api-docs"},(0,n.yg)("a",{id:"kafka-emitter"}),(0,n.yg)("p",null,"The Kafka emitter can be used to push metadata to DataHub."),(0,n.yg)("h3",{id:"datahub.emitter.kafka_emitter.DatahubKafkaEmitter"},(0,n.yg)("span",{className:"visually-hidden"},"DatahubKafkaEmitter")),(0,n.yg)("div",{className:"h3-block"},(0,n.yg)("div",{className:"section-heading"},(0,n.yg)("span",{class:"class-text"},"class")," ",(0,n.yg)("span",{class:"class-owner"},"datahub.emitter.kafka_emitter."),(0,n.yg)("span",{class:"class-name"},"DatahubKafkaEmitter"),"(",(0,n.yg)("span",{class:"arg-name"},"config"),")",(0,n.yg)("a",{href:"#datahub.emitter.kafka_emitter.DatahubKafkaEmitter",class:"hash-link"})),(0,n.yg)("p",null,"Bases: ",(0,n.yg)("inlineCode",{parentName:"p"},"Closeable"),", ",(0,n.yg)("inlineCode",{parentName:"p"},"Emitter")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Parameters:"),(0,n.yg)("strong",{parentName:"li"},"config")," (",(0,n.yg)("a",{parentName:"li",href:"#datahub.emitter.kafka_emitter.KafkaEmitterConfig"},(0,n.yg)("inlineCode",{parentName:"a"},"KafkaEmitterConfig")),") \u2013 ")),(0,n.yg)("h4",{id:"close"},"close()"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Return type:"),(0,n.yg)("inlineCode",{parentName:"li"},"None"))),(0,n.yg)("h4",{id:"emititem-callbacknone"},"emit(item, callback=None)"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Parameters:"),(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"item")," (",(0,n.yg)("inlineCode",{parentName:"li"},"Union"),"[",(0,n.yg)("a",{parentName:"li",href:"/docs/python-sdk/models#datahub.metadata.schema_classes.MetadataChangeEventClass"},(0,n.yg)("inlineCode",{parentName:"a"},"MetadataChangeEventClass")),", ",(0,n.yg)("a",{parentName:"li",href:"/docs/python-sdk/models#datahub.metadata.schema_classes.MetadataChangeProposalClass"},(0,n.yg)("inlineCode",{parentName:"a"},"MetadataChangeProposalClass")),", ",(0,n.yg)("a",{parentName:"li",href:"/docs/python-sdk/builder/mcp-builder#datahub.emitter.mcp.MetadataChangeProposalWrapper"},(0,n.yg)("inlineCode",{parentName:"a"},"MetadataChangeProposalWrapper")),"]) \u2013 "),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"callback")," (",(0,n.yg)("inlineCode",{parentName:"li"},"Optional"),"[",(0,n.yg)("inlineCode",{parentName:"li"},"Callable"),"[","[",(0,n.yg)("inlineCode",{parentName:"li"},"Exception"),", ",(0,n.yg)("inlineCode",{parentName:"li"},"str"),"]",", ",(0,n.yg)("inlineCode",{parentName:"li"},"None"),"]])"))),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Return type:"),(0,n.yg)("inlineCode",{parentName:"li"},"None"))),(0,n.yg)("h4",{id:"emit_mce_asyncmce-callback"},"emit_mce_async(mce, callback)"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Parameters:"),(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"mce")," (",(0,n.yg)("a",{parentName:"li",href:"/docs/python-sdk/models#datahub.metadata.schema_classes.MetadataChangeEventClass"},(0,n.yg)("inlineCode",{parentName:"a"},"MetadataChangeEventClass")),") \u2013 "),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"callback")," (",(0,n.yg)("inlineCode",{parentName:"li"},"Callable"),"[","[",(0,n.yg)("inlineCode",{parentName:"li"},"Exception"),", ",(0,n.yg)("inlineCode",{parentName:"li"},"str"),"]",", ",(0,n.yg)("inlineCode",{parentName:"li"},"None"),"])"))),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Return type:"),(0,n.yg)("inlineCode",{parentName:"li"},"None"))),(0,n.yg)("h4",{id:"emit_mcp_asyncmcp-callback"},"emit_mcp_async(mcp, callback)"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Parameters:"),(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"mcp")," (",(0,n.yg)("inlineCode",{parentName:"li"},"Union"),"[",(0,n.yg)("a",{parentName:"li",href:"/docs/python-sdk/models#datahub.metadata.schema_classes.MetadataChangeProposalClass"},(0,n.yg)("inlineCode",{parentName:"a"},"MetadataChangeProposalClass")),", ",(0,n.yg)("a",{parentName:"li",href:"/docs/python-sdk/builder/mcp-builder#datahub.emitter.mcp.MetadataChangeProposalWrapper"},(0,n.yg)("inlineCode",{parentName:"a"},"MetadataChangeProposalWrapper")),"]) \u2013 "),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"callback")," (",(0,n.yg)("inlineCode",{parentName:"li"},"Callable"),"[","[",(0,n.yg)("inlineCode",{parentName:"li"},"Exception"),", ",(0,n.yg)("inlineCode",{parentName:"li"},"str"),"]",", ",(0,n.yg)("inlineCode",{parentName:"li"},"None"),"])"))),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Return type:"),(0,n.yg)("inlineCode",{parentName:"li"},"None"))),(0,n.yg)("h4",{id:"flush"},"flush()"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Return type:"),(0,n.yg)("inlineCode",{parentName:"li"},"None")))),(0,n.yg)("h3",{id:"datahub.emitter.kafka_emitter.KafkaEmitterConfig"},(0,n.yg)("span",{className:"visually-hidden"},"KafkaEmitterConfig")),(0,n.yg)("div",{className:"h3-block"},(0,n.yg)("div",{className:"section-heading"},(0,n.yg)("span",{class:"class-text"},"class")," ",(0,n.yg)("span",{class:"class-owner"},"datahub.emitter.kafka_emitter."),(0,n.yg)("span",{class:"class-name"},"KafkaEmitterConfig"),"(",(0,n.yg)("span",{class:"arg-name"},"**data"),")",(0,n.yg)("a",{href:"#datahub.emitter.kafka_emitter.KafkaEmitterConfig",class:"hash-link"})),(0,n.yg)("p",null,"Bases: ",(0,n.yg)("inlineCode",{parentName:"p"},"ConfigModel")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Parameters:"),(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"data")," (",(0,n.yg)("inlineCode",{parentName:"li"},"Any"),")"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"connection")," (",(0,n.yg)("em",{parentName:"li"},"KafkaProducerConnectionConfig"),")"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"topic_routes")," (",(0,n.yg)("em",{parentName:"li"},"Dict")," ",(0,n.yg)("em",{parentName:"li"},"[",(0,n.yg)("strong",{parentName:"em"},"str"),",",(0,n.yg)("strong",{parentName:"em"},"str"),"]"),")")))),(0,n.yg)("h4",{id:"connection--kafkaproducerconnectionconfig"},"connection ",(0,n.yg)("em",{parentName:"h4"},": ",(0,n.yg)("inlineCode",{parentName:"em"},"KafkaProducerConnectionConfig"))),(0,n.yg)("h4",{id:"model_config--classvarconfigdict--_schema_extra-function-configmodelconfig_schema_extra-extra-forbid-ignored_types-class-cached_propertycached_property-json_schema_extra-function-configmodelconfig_schema_extra"},"model_config ",(0,n.yg)("em",{parentName:"h4"},": ClassVar","[ConfigDict]")," ",(0,n.yg)("em",{parentName:"h4"},"= {'_schema_extra': ","<","function ConfigModel.Config._schema_extra>, 'extra': 'forbid', 'ignored_types': (<class 'cached_property.cached_property'>,), 'json_schema_extra': ","<","function ConfigModel.Config._schema_extra>}")),(0,n.yg)("p",null,"Configuration for the model, should be a dictionary conforming to ","[ConfigDict][pydantic.config.ConfigDict]","."),(0,n.yg)("h4",{id:"topic_routes--dictstr-str"},"topic_routes ",(0,n.yg)("em",{parentName:"h4"},": ",(0,n.yg)("inlineCode",{parentName:"em"},"Dict"),"[",(0,n.yg)("inlineCode",{parentName:"em"},"str"),", ",(0,n.yg)("inlineCode",{parentName:"em"},"str"),"]")),(0,n.yg)("h4",{id:"classmethod-validate_topic_routesv"},(0,n.yg)("em",{parentName:"h4"},"classmethod")," validate_topic_routes(v)"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Parameters:"),(0,n.yg)("strong",{parentName:"li"},"v")," (",(0,n.yg)("inlineCode",{parentName:"li"},"Dict"),"[",(0,n.yg)("inlineCode",{parentName:"li"},"str"),", ",(0,n.yg)("inlineCode",{parentName:"li"},"str"),"]",")"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Return type:"),(0,n.yg)("inlineCode",{parentName:"li"},"Dict"),"[",(0,n.yg)("inlineCode",{parentName:"li"},"str"),", ",(0,n.yg)("inlineCode",{parentName:"li"},"str"),"]")))))}d.isMDXComponent=!0}}]); |