MCP Builder
These classes and methods make it easier to construct MetadataChangeProposals.
MetadataChangeProposalWrapper
Bases: object
- Parameters:
- entityType (
str
) - changeType (
Union
[str
,ChangeTypeClass
]) – - entityUrn (
Optional
[str
]) - entityKeyAspect (
Optional
[_Aspect
]) - auditHeader (
Optional
[KafkaAuditHeaderClass
]) – - aspectName (
Optional
[str
]) - aspect (
Optional
[_Aspect
]) - systemMetadata (
Optional
[SystemMetadataClass
]) – - headers (
Optional
[Dict
[str
,str
]])
- entityType (
as_workunit(*, treat_errors_as_warnings=False, is_primary_source=True)
- Parameters:
- treat_errors_as_warnings (
bool
) - is_primary_source (
bool
)
- treat_errors_as_warnings (
- Return type:
MetadataWorkUnit
aspect : Optional
[_Aspect
] = None
aspectName : Optional
[str
] = None
auditHeader : Optional
[KafkaAuditHeaderClass
] = None
changeType : Union
[str
, ChangeTypeClass
] = 'UPSERT'
classmethod construct_many(entityUrn, aspects)
- Parameters:
- entityUrn (
str
) - aspects (
Sequence
[Optional
[_Aspect
]])
- entityUrn (
- Return type:
List
[MetadataChangeProposalWrapper
]
entityKeyAspect : Optional
[_Aspect
] = None
entityType : str
= 'ENTITY_TYPE_UNSET'
entityUrn : Optional
[str
] = None
classmethod from_obj(obj, tuples=False)
Attempt to deserialize into an MCPW, but fall back to a standard MCP if we’re missing codegen’d classes for the entity key or aspect.
- Parameters:
- obj (
dict
) - tuples (
bool
)
- obj (
- Return type:
Union
[MetadataChangeProposalWrapper
,MetadataChangeProposalClass
]
classmethod from_obj_require_wrapper(obj, tuples=False)
- Parameters:
- obj (
dict
) - tuples (
bool
)
- obj (
- Return type:
MetadataChangeProposalWrapper
headers : Optional
[Dict
[str
, str
]] = None
make_mcp()
- Return type:
MetadataChangeProposalClass
systemMetadata : Optional
[SystemMetadataClass
] = None
to_obj(tuples=False, simplified_structure=False)
- Parameters:
- tuples (
bool
) - simplified_structure (
bool
)
- tuples (
- Return type:
dict
classmethod try_from_mcl(mcl)
- Parameters:mcl (
MetadataChangeLogClass
) – - Return type:
Union
[MetadataChangeProposalWrapper
,MetadataChangeProposalClass
]
classmethod try_from_mcpc(mcpc)
Attempts to create a MetadataChangeProposalWrapper from a MetadataChangeProposalClass. Neatly handles unsupported, expected cases, such as unknown aspect types or non-json content type.
- Raises:Exception if the generic aspect is invalid**,** e.g. contains invalid json. –
- Parameters:mcpc (
MetadataChangeProposalClass
) – - Return type:
Optional
[MetadataChangeProposalWrapper
]
validate()
- Return type:
bool
BigQueryDatasetKey
Bases: ProjectIdKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- project_id (str)
- dataset_id (str)
- data (
dataset_id : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
BucketKey
Bases: ContainerKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- bucket_name (str)
- data (
bucket_name : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
CatalogKey
Bases: ContainerKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- catalog (str)
- data (
catalog : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
CatalogKeyWithMetastore
Bases: MetastoreKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- metastore (str)
- catalog (str)
- data (
catalog : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
ContainerKey
Bases: DatahubKey
Base class for container guid keys. Most users should use one of the subclasses instead.
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- data (
as_urn()
- Return type:
str
as_urn_typed()
- Return type:
ContainerUrn
backcompat_env_as_instance : bool
env : Optional
[str
]
guid_dict()
- Return type:
Dict
[str
,str
]
instance : Optional
[str
]
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
parent_key()
- Return type:
Optional
[ContainerKey
]
platform : str
property_dict()
- Return type:
Dict
[str
,str
]
DatabaseKey
Bases: ContainerKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- database (str)
- data (
database : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
DatahubKey
Bases: BaseModel
- Parameters:data (
Any
)
guid()
- Return type:
str
guid_dict()
- Return type:
Dict
[str
,str
]
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
ExperimentKey
Bases: ContainerKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- id (str)
- data (
id : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
FolderKey
Bases: ContainerKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- folder_abs_path (str)
- data (
folder_abs_path : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
MetastoreKey
Bases: ContainerKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- metastore (str)
- data (
metastore : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
NamespaceKey
Bases: ContainerKey
For Iceberg namespaces (databases/schemas)
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- namespace (str)
- data (
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
namespace : str
NotebookKey
Bases: DatahubKey
- Parameters:
- data (
Any
) - notebook_id (int)
- platform (str)
- instance (str | None)
- data (
as_urn()
- Return type:
str
instance : Optional
[str
]
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
notebook_id : int
platform : str
PlatformKey
alias of ContainerKey
ProjectIdKey
Bases: ContainerKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- project_id (str)
- data (
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
project_id : str
SchemaKey
Bases: DatabaseKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- database (str)
- schema (str)
- data (
db_schema : str
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
UnitySchemaKey
Bases: CatalogKey
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- catalog (str)
- unity_schema (str)
- data (
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
unity_schema : str
UnitySchemaKeyWithMetastore
Bases: CatalogKeyWithMetastore
- Parameters:
- data (
Any
) - platform (str)
- instance (str | None)
- env (str | None)
- backcompat_env_as_instance (bool)
- metastore (str)
- catalog (str)
- unity_schema (str)
- data (
model_config : ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
unity_schema : str
add_dataset_to_container
- Parameters:
- container_key (
TypeVar
(KeyType
, bound=ContainerKey
)) – - dataset_urn (
str
)
- container_key (
- Return type:
Iterable
[MetadataWorkUnit
]
add_domain_to_entity_wu
- Parameters:
- entity_urn (
str
) - domain_urn (
str
)
- entity_urn (
- Return type:
Iterable
[MetadataWorkUnit
]
add_entity_to_container
- Parameters:
- container_key (
TypeVar
(KeyType
, bound=ContainerKey
)) – - entity_type (
str
) - entity_urn (
str
)
- container_key (
- Return type:
Iterable
[MetadataWorkUnit
]
add_owner_to_entity_wu
- Parameters:
- entity_type (
str
) - entity_urn (
str
) - owner_urn (
str
)
- entity_type (
- Return type:
Iterable
[MetadataWorkUnit
]
add_structured_properties_to_entity_wu
- Parameters:
- entity_urn (
str
) - structured_properties (
Dict
[StructuredPropertyUrn
,str
]) –
- entity_urn (
- Return type:
Iterable
[MetadataWorkUnit
]
add_tags_to_entity_wu
- Parameters:
- entity_type (
str
) - entity_urn (
str
) - tags (
List
[str
])
- entity_type (
- Return type:
Iterable
[MetadataWorkUnit
]
create_embed_mcp
- Parameters:
- urn (
str
) - embed_url (
str
)
- urn (
- Return type:
MetadataChangeProposalWrapper
entity_supports_aspect
- Parameters:
- entity_type (
str
) - aspect_type (
Type
[TypeVar
(Aspect
, bound=_Aspect
)]) –
- entity_type (
- Return type:
bool
gen_containers
- Parameters:
- container_key (
TypeVar
(KeyType
, bound=ContainerKey
)) – - name (
str
) - sub_types (
List
[str
]) - parent_container_key (
Optional
[ContainerKey
]) – - extra_properties (
Optional
[Dict
[str
,str
]]) - structured_properties (
Optional
[Dict
[StructuredPropertyUrn
,str
]]) – - domain_urn (
Optional
[str
]) - description (
Optional
[str
]) - owner_urn (
Optional
[str
]) - external_url (
Optional
[str
]) - tags (
Optional
[List
[str
]]) - qualified_name (
Optional
[str
]) - created (
Optional
[int
]) - last_modified (
Optional
[int
])
- container_key (
- Return type:
Iterable
[MetadataWorkUnit
]
mcps_from_mce
- Parameters:mce (
MetadataChangeEventClass
) – - Return type:
Iterable
[MetadataChangeProposalWrapper
]