pyapacheatlas.core.client.PurviewClient.upload_typedefs#

PurviewClient.upload_typedefs(typedefs=None, force_update=False, **kwargs)#

Provides a way to upload a single or multiple type definitions. If you provide one type def, it will format the required wrapper for you based on the type category.

If you want to upload multiple type defs or typedefs of different category, you can pass the in kwargs entityDefs, classificationDefs, enumDefs, relationshipDefs, structDefs which take in a list of dicts or appropriate TypeDef objects.

Otherwise, you can pass in the wrapper yourself (e.g. {“entityDefs”:[], “relationshipDefs”:[]}) by providing that dict to the typedefs parameter. If the dict you pass in contains at least one of these Def fields it will be considered valid and an upload will be attempted.

typedefs also takes in a BaseTypeDef object or a valid AtlasTypeDef json / dict. If you provide a value in typedefs, it will ignore the kwargs parameters.

When using force_update, it will look up all existing types and see if any of your provided types exist. If they do exist, they will be updated. If they do not exist, they will be issued as new. New types are uploaded first. Existing types are updated second. There are no transactional updates. New types can succeed and be inserted while a batch of existing types can fail and not be updated.

Parameters
  • typedefs (Union(dict, BaseTypeDef)) – The set of type definitions you want to upload.

  • force_update (bool) – Set to True if your typedefs contains any existing entities.

Returns

The results of your upload attempt from the Atlas server. :rtype: dict

Kwargs:
param entityDefs

EntityDefs to upload.

type entityDefs

list( Union(BaseTypeDef, dict))

param classificationDefs

classificationDefs to upload.

type classificationDefs

list( Union(BaseTypeDef, dict))

param enumDefs

enumDefs to upload.

type enumDefs

list( Union(BaseTypeDef, dict))

param relationshipDefs

relationshipDefs to upload.

type relationshipDefs

list( Union(BaseTypeDef, dict))

param structDefs

structDefs to upload.

type structDefs

list( Union(BaseTypeDef, dict))

param businessMetadataDefs

businessMetadataDefs to upload.

type businessMetadataDefs

list( Union(BaseTypeDef, dict))