foundry_dev_tools.utils.api_types module

Contents

foundry_dev_tools.utils.api_types module#

Defines types for the Foundry API, for better readability of the code.

foundry_dev_tools.utils.api_types.assert_in_literal(option, literal, variable_name)[source]#

Raise a TypeError when the passed option is not contained in the literal.

Parameters:
  • option – An option from the list of options from literal

  • literal – The literal variable defining all the valid options

  • variable_name – The name of the literal variable

Return type:

None

foundry_dev_tools.utils.api_types.Rid#

A resource identifier.

foundry_dev_tools.utils.api_types.TransactionRid#

A transaction resource identifier.

foundry_dev_tools.utils.api_types.DatasetRid#

A dataset resource identifier.

foundry_dev_tools.utils.api_types.RepositoryRid#

A repository resource identifier.

foundry_dev_tools.utils.api_types.FoundryPath#

A path on foundry.

foundry_dev_tools.utils.api_types.PathInDataset#

A path in a dataset.

foundry_dev_tools.utils.api_types.PathInRepository#

A path in a repository.

foundry_dev_tools.utils.api_types.Ref#

A git ref (branch,commit,tag,…).

foundry_dev_tools.utils.api_types.DatasetBranch#

Name of a branch in a dataset.

foundry_dev_tools.utils.api_types.View#

A view, which is a Ref or a TransactionRid.

foundry_dev_tools.utils.api_types.RoleId#

A role in foundry (Owner, Editor, Viewer, Discoverer,…)

foundry_dev_tools.utils.api_types.FolderRid#

A compass folder resource identifier.

foundry_dev_tools.utils.api_types.JobSpecRid#

A jobspec resource identifier.

foundry_dev_tools.utils.api_types.OrganizationRid#

An organization resource identifier.

foundry_dev_tools.utils.api_types.ProjectRid#

A compass project root folder resource identifier.

foundry_dev_tools.utils.api_types.FoundryTransaction#

Foundry transaction types.

alias of Literal[‘SNAPSHOT’, ‘UPDATE’, ‘APPEND’, ‘DELETE’]

foundry_dev_tools.utils.api_types.GroupId#

A group identifier on Foundry

foundry_dev_tools.utils.api_types.SqlDialect#

The SQL Dialect for Foundry SQL queries.

alias of Literal[‘ANSI’, ‘SPARK’]

foundry_dev_tools.utils.api_types.SQLReturnType#

The return_types for sql queries.

pandas: pandas.DataFrame arrow: pyarrow.Table spark: DataFrame raw: Tuple of (foundry_schema, data) (can only be used in legacy)

alias of Literal[‘pandas’, ‘spark’, ‘arrow’, ‘raw’]

foundry_dev_tools.utils.api_types.MultipassClientType#

Multipass client types.

alias of Literal[‘CONFIDENTIAL’, ‘PUBLIC’]

foundry_dev_tools.utils.api_types.MultipassGrantType#

Multipass grant types.

alias of Literal[‘AUTHORIZATION_CODE’, ‘CLIENT_CREDENTIALS’, ‘REFRESH_TOKEN’]

foundry_dev_tools.utils.api_types.TokenId#

An identifier for a token issued by foundry.

foundry_dev_tools.utils.api_types.TokenType#

The type of a token.

alias of Literal[‘USER_GENERATED’]

foundry_dev_tools.utils.api_types.UserId#

An identifier for an user on foundry.

class foundry_dev_tools.utils.api_types.Attribution[source]#

Bases: TypedDict

User and timestamp for resource creation.

time: str#
user_id: str#
class foundry_dev_tools.utils.api_types.CompassBranch[source]#

Bases: TypedDict

Resource branches.

name: str#
rid: str#
urlVariables: dict[str, Any]#
classificationRids: set[str] | None#
class foundry_dev_tools.utils.api_types.Branch[source]#

Bases: TypedDict

Dataset branches.

id: str#
rid: str#
ancestorBranchIds: list[str]#
creationTime: str#
transactionRid: str | None#
class foundry_dev_tools.utils.api_types.ClassificationBanner[source]#

Bases: TypedDict

Classification information for banners.

classificationString: str#
class foundry_dev_tools.utils.api_types.MarkingInfo[source]#

Bases: TypedDict

Marking representation.

markingId: str#
markingName: str#
categoryId: str#
categoryname: str#
categoryType: Literal['DISJUNCTIVE', 'CONJUNCTIVE']#
organizationRid: str | None#
isOrganization: bool#
isDirectlyApplied: bool | None#
disjunctiveInheritedConjunctively: bool | None#
isCbac: bool#
class foundry_dev_tools.utils.api_types.BranchWithMarkings[source]#

Bases: TypedDict

Resource branch with markings.

branch: Branch#
markings: set[MarkingInfo]#
satisfiesConstraints: bool#
classificationBanner: ClassificationBanner | None#
class foundry_dev_tools.utils.api_types.BackedObjectTypeInfo[source]#

Bases: TypedDict

Object type backed by dataset.

id: str#
class foundry_dev_tools.utils.api_types.Deprecation[source]#

Bases: TypedDict

Deprecation info for resource.

message: str | None#
alternativeResourceRid: str | None#
class foundry_dev_tools.utils.api_types.NamedResourceIdentifier[source]#

Bases: TypedDict

Represantion for name/rid.

rid: str#
name: str#
class foundry_dev_tools.utils.api_types.LinkedItem[source]#

Bases: TypedDict

type: str#
rid: str#
attribution: Attribution#
class foundry_dev_tools.utils.api_types.Contact[source]#

Bases: TypedDict

Contact for a resource.

groupId: str | None#
principalId: str#
class foundry_dev_tools.utils.api_types.ContactInformation[source]#

Bases: TypedDict

Information about resource contact.

primaryContact: Contact#
class foundry_dev_tools.utils.api_types.Classification[source]#

Bases: TypedDict

Classification for resource.

userConstraintClassificationBanner: ClassificationBanner | None#
resourceClassificationBanner: ClassificationBanner | None#
class foundry_dev_tools.utils.api_types.TransactionMetadata[source]#

Bases: TypedDict

Foundry transaction metadata API object.

fileCount: int#
totalFileSize: int#
hiddenFileCount: int#
totalHiddenFileSize: int#
class foundry_dev_tools.utils.api_types.TransactionRange[source]#

Bases: TypedDict

Foundry transaction range API object.

startTransactionRid: str#
endTransactionRid: str#
class foundry_dev_tools.utils.api_types.ProvenanceRecord[source]#

Bases: TypedDict

Foundry provenance record API object.

datasetRid: str#
transactionRange: TransactionRange | None#
schemaBranchId: str | None#
schemaVersionId: str | None#
nonCatalogResources: list[str]#
assumedMarkings: set[str]#
class foundry_dev_tools.utils.api_types.NonCatalogProvenanceRecord[source]#

Bases: TypedDict

Foundry NonCatalogProvenanceRecord API object.

resources: set[str]#
assumedMarkings: set[str]#
dependencyType: Literal['SECURED', 'UNSECURED'] | None#
class foundry_dev_tools.utils.api_types.TransactionProvenance[source]#

Bases: TypedDict

Foundry TransactionProvenance API object.

provenanceRecords: set[ProvenanceRecord]#
nonCatalogProvenanceRecords: set[NonCatalogProvenanceRecord]#
class foundry_dev_tools.utils.api_types.Transaction[source]#

Bases: TypedDict

Foundry transaction API object.

type: Literal['UPDATE', 'APPEND', 'DELETE', 'SNAPSHOT', 'UNDEFINED']#
status: Literal['OPEN', 'COMMITTED', 'ABORTED']#
filePathType: Literal['NO_FILES', 'MANAGED_FILES', 'REGISTERED_FILES']#
startTime: str#
closeTime: str | None#
permissionPath: str | None#
record: dict[str, Any] | None#
attribution: Attribution | None#
metadata: TransactionMetadata | None#
isDataDeleted: bool#
isDeletionComplete: bool#
rid: str#
provenance: TransactionProvenance | None#
datasetRid: str#
class foundry_dev_tools.utils.api_types.SecuredTransaction[source]#

Bases: TypedDict

Foundry SecuredTransaction API object.

transaction: Transaction#
rid: str#
class foundry_dev_tools.utils.api_types.DatasetIdentity[source]#

Bases: TypedDict

Foundry DatasetIdentity API object.

dataset_path: str#
dataset_rid: str#
last_transaction_rid: str | None#
last_transaction: SecuredTransaction | None#
foundry_dev_tools.utils.api_types.PatchOperation#

Foundry PatchOperation enum.

alias of Literal[‘ADD’, ‘REMOVE’]

foundry_dev_tools.utils.api_types.FieldType#

Foundry FieldType enum.

alias of Literal[‘NAME’, ‘LAST_MODIFIED’]

foundry_dev_tools.utils.api_types.SortDirection#

Foundry SortDirection enum.

alias of Literal[‘ASC’, ‘DESC’]

class foundry_dev_tools.utils.api_types.SortSpec[source]#

Bases: TypedDict

Foundry SortSpec API object.

field: Literal['NAME', 'LAST_MODIFIED']#
direction: Literal['ASC', 'DESC']#
foundry_dev_tools.utils.api_types.PrincipalType#

Foundry PrincipalType enum.

alias of Literal[‘EVERYONE’, ‘GROUP’, ‘USER’]

class foundry_dev_tools.utils.api_types.Principal[source]#

Bases: TypedDict

Foundry Principal API object.

id: str#
type: Literal['EVERYONE', 'GROUP', 'USER']#
class foundry_dev_tools.utils.api_types.RoleGrant[source]#

Bases: TypedDict

Foundry RoleGrant API object.

role: str#
principal: Principal#
class foundry_dev_tools.utils.api_types.RoleGrantPatch[source]#

Bases: TypedDict

Foundry RoleGrantPatch API object.

roleGrant: RoleGrant#
patchOperation: Literal['ADD', 'REMOVE']#
foundry_dev_tools.utils.api_types.UserGroupPrincipalType#

Foundry UserGroupPrincipalType enum.

alias of Literal[‘GROUP’, ‘USER’]

class foundry_dev_tools.utils.api_types.UserGroupPrincipal[source]#

Bases: TypedDict

Foundry UserGroupPrincipal API object.

id: str#
type: Literal['GROUP', 'USER']#
class foundry_dev_tools.utils.api_types.UserGroupPrincipalPatch[source]#

Bases: TypedDict

Foundry UserGroupPrincipalPatch API object.

principal: UserGroupPrincipal#
patchOperation: Literal['ADD', 'REMOVE']#
class foundry_dev_tools.utils.api_types.ResourceGrantsResult[source]#

Bases: TypedDict

Foundry ResourceGrantsResult API object.

grants: set[RoleGrant]#
disableInheritedPermissionsForPrincipals: set[UserGroupPrincipal]#
disableInheritedPermissions: bool#
disableInheritedPermissionsType: Literal['NONE', 'ALL', 'ALL_WITHOUT_MANDATORY']#
foundry_dev_tools.utils.api_types.RoleContext#

Foundry RoleContext.

alias of Literal[‘MARKETPLACE_INSTALLATION’, ‘ONTOLOGY’, ‘PROJECT’, ‘TABLES’, ‘TELEMETRY’, ‘USE_CASE’]

foundry_dev_tools.utils.api_types.RoleSetId#

Foundry RoleSet identifier.

class foundry_dev_tools.utils.api_types.RoleSetUpdate[source]#

Bases: TypedDict

Foundry RoleSetUpdate API object.

currentRoleSet: str#
targetRoleSet: str#
rolesMap: dict[str, set[str]]#
class foundry_dev_tools.utils.api_types.MarkingPatch[source]#

Bases: TypedDict

Foundry MarkingPatch API object.

markingId: str#
patchOperation: Literal['ADD', 'REMOVE']#
class foundry_dev_tools.utils.api_types.CbacMarkingConstraint[source]#

Bases: TypedDict

Foundry CbacMarkingConstraint API object.

markingIds: set[str]#
foundry_dev_tools.utils.api_types.MandatoryMarkingConstraintPatchType#

Foundry MandatoryMarkingConstraintPatchType.

alias of Literal[‘ALLOWED’, ‘DENIED’, ‘NONE’]

class foundry_dev_tools.utils.api_types.MandatoryMarkingConstraintPatches[source]#

Bases: TypedDict

Foundry MandatoryMarkingConstraintPatches API object.

markingPatches: list[MarkingPatch]#
type: Literal['ALLOWED', 'DENIED', 'NONE']#
class foundry_dev_tools.utils.api_types.ProjectFolderDisplaySettingsUpdate[source]#

Bases: TypedDict

Foundry ProjectFolderDisplaySettingsUpdate API object.

showLinkedOntologyEntitiesTab: bool | None#
showReleaseAndPublishTab: bool | None#
foundry_dev_tools.utils.api_types.MavenProductId#

Foundry MavenProduct identifier.

foundry_dev_tools.utils.api_types.MoveResourcesOption#

Foundry MoveResourcesOption to be used when moving resources

alias of Literal[‘ALLOW_MOVING_TO_HIDDEN’, ‘REMOVE_ROLE_GRANTS’, ‘DECONFLICT_NAME’]

foundry_dev_tools.utils.api_types.ImportType#

Foundry import types as indicator for Compass-tracked (file-system) respectively non-Compass-tracked (external) resources.

alias of Literal[‘EXTERNAL’, ‘FILE_SYSTEM’]

class foundry_dev_tools.utils.api_types.User[source]#

Bases: TypedDict

Foundry multipass user.

id: str#
username: str#
attributes: dict[str, list[str]]#
class foundry_dev_tools.utils.api_types.Group[source]#

Bases: TypedDict

Foundry multipass group.

id: str#
name: str#
attributes: dict[str, list[str]]#
class foundry_dev_tools.utils.api_types.GroupMemberExpirationSettings[source]#

Bases: TypedDict

Foundry GroupMemberExpirationSettings API object.

maxExpiration: datetime | None#

The time in the future on which all memberships will be automatically expired.

maxDurationInSeconds: int | None#

The time after which membership expires when adding a principal to a group or updating their membership expiration time.

class foundry_dev_tools.utils.api_types.DatasetsJobSpecSelection[source]#

Bases: TypedDict

Foundry DatasetsJobSpecSelection API object.

datasetRids: list[str]#
isRequired: bool#
class foundry_dev_tools.utils.api_types.JobSpecJobSpecsSelection[source]#

Bases: TypedDict

Foundry JobSpecJobSpecsSelection API object.

jobSpecRids: list[str]#
isRequired: bool#
class foundry_dev_tools.utils.api_types.UpstreamJobSpecSelection[source]#

Bases: TypedDict

Foundry UpstreamJobSpecSelection API object.

datasetRids: list[str]#
datasetRidsToIgnore: list[str]#
class foundry_dev_tools.utils.api_types.ConnectingJobSpecSelection[source]#

Bases: TypedDict

Foundry ConnectingJobSpecSelection API object.

upstreamDatasetRids: list[str]#
downstreamDatasetRids: list[str]#
datasetRidsToIgnore: list[str]#
foundry_dev_tools.utils.api_types.ExceededDurationMode#

Foundry ExceededDurationMode.

alias of Literal[‘CANCEL’, ‘RETRY’]

foundry_dev_tools.utils.api_types.InputFailureStrategy#

Foundry InputFailureStrategy.

CONTINUE: Will attempt to continue running the job, requesting that the input manager resolve the dataset properties

of the input dataset as if the failed job had never run

FAIL: will fail the job when one of its inputs fails

alias of Literal[‘CONTINUE’, ‘FAIL’]

class foundry_dev_tools.utils.api_types.InputStrategy[source]#

Bases: TypedDict

Foundry InputStrategy API object.

inputDatasetRid: str#
failureStrategy: Literal['CONTINUE', 'FAIL']#
foundry_dev_tools.utils.api_types.OutputQueueStrategy#

Foundry OutputQueueingStrategy.

QUEUE_UP: The new job is placed into the queue for the output SUPERSEDE: The new job is placed into the queue for the output and a cancellation signal is sent to the running job

and the other queued jobs to pop them off the queue and stop execution

alias of Literal[‘QUEUE_UP’, ‘SUPERSEDE’]