FinSpaceData

Client

class FinSpaceData.Client

A low-level client representing FinSpace Public API (FinSpace Data)

The FinSpace APIs let you take actions inside the FinSpace environment.

client = session.create_client('finspace-data')

These are the available methods:

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters:

operation_name (string) – The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you’d normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").

Returns:

True if the operation can be paginated, False otherwise.

create_changeset(**kwargs)

Creates a new changeset in a FinSpace dataset.

See also: AWS API Documentation

Request Syntax

response = client.create_changeset(
    datasetId='string',
    changeType='REPLACE'|'APPEND'|'MODIFY',
    sourceType='S3',
    sourceParams={
        'string': 'string'
    },
    formatType='CSV'|'JSON'|'PARQUET'|'XML',
    formatParams={
        'string': 'string'
    },
    tags={
        'string': 'string'
    }
)
Parameters:
  • datasetId (string) –

    [REQUIRED]

    The unique identifier for the FinSpace dataset in which the changeset will be created.

  • changeType (string) –

    [REQUIRED]

    Option to indicate how a changeset will be applied to a dataset.

    • REPLACE - Changeset will be considered as a replacement to all prior loaded changesets.

    • APPEND - Changeset will be considered as an addition to the end of all prior loaded changesets.

  • sourceType (string) –

    [REQUIRED]

    Type of the data source from which the files to create the changeset will be sourced.

    • S3 - Amazon S3.

  • sourceParams (dict) –

    [REQUIRED]

    Source path from which the files to create the changeset will be sourced.

    • (string) –

      • (string) –

  • formatType (string) – Format type of the input files being loaded into the changeset.

  • formatParams (dict) –

    Options that define the structure of the source file(s).

    • (string) –

      • (string) –

  • tags (dict) –

    Metadata tags to apply to this changeset.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'changeset': {
        'id': 'string',
        'changesetArn': 'string',
        'datasetId': 'string',
        'changeType': 'REPLACE'|'APPEND'|'MODIFY',
        'sourceType': 'S3',
        'sourceParams': {
            'string': 'string'
        },
        'formatType': 'CSV'|'JSON'|'PARQUET'|'XML',
        'formatParams': {
            'string': 'string'
        },
        'createTimestamp': datetime(2015, 1, 1),
        'status': 'PENDING'|'FAILED'|'SUCCESS'|'RUNNING'|'STOP_REQUESTED',
        'errorInfo': {
            'errorMessage': 'string',
            'errorCategory': 'The_inputs_to_this_request_are_invalid'|'Service_limits_have_been_exceeded'|'Missing_required_permission_to_perform_this_request'|'One_or_more_inputs_to_this_request_were_not_found'|'The_system_temporarily_lacks_sufficient_resources_to_process_the_request'|'An_internal_error_has_occurred'|'Cancelled'|'A_user_recoverable_error_has_occurred'
        },
        'changesetLabels': {
            'string': 'string'
        },
        'updatesChangesetId': 'string',
        'updatedByChangesetId': 'string'
    }
}

Response Structure

  • (dict) –

    • changeset (dict) –

      Returns the changeset details.

      • id (string) –

        Unique identifier for a changeset.

      • changesetArn (string) –

        The ARN identifier of the changeset.

      • datasetId (string) –

        The unique identifier for the FinSpace dataset in which the changeset is created.

      • changeType (string) –

        Change type indicates how a changeset is applied to a dataset.

        • REPLACE - Changeset is considered as a replacement to all prior loaded changesets.

        • APPEND - Changeset is considered as an addition to the end of all prior loaded changesets.

        • MODIFY - Changeset is considered as a replacement to a specific prior ingested changeset.

      • sourceType (string) –

        Type of the data source from which the files to create the changeset are sourced.

        • S3 - Amazon S3.

      • sourceParams (dict) –

        Source path from which the files to create the changeset are sourced.

        • (string) –

          • (string) –

      • formatType (string) –

        Format type of the input files loaded into the changeset.

      • formatParams (dict) –

        Structure of the source file(s).

        • (string) –

          • (string) –

      • createTimestamp (datetime) –

        The timestamp at which the changeset was created in FinSpace.

      • status (string) –

        The status of changeset creation operation.

      • errorInfo (dict) –

        The structure with error messages.

        • errorMessage (string) –

          The text of the error message.

        • errorCategory (string) –

          The category of the error.

          • VALIDATION -The inputs to this request are invalid.

          • SERVICE_QUOTA_EXCEEDED - Service quotas have been exceeded. Please contact AWS support to increase quotas.

          • ACCESS_DENIED - Missing required permission to perform this request.

          • RESOURCE_NOT_FOUND - One or more inputs to this request were not found.

          • THROTTLING - The system temporarily lacks sufficient resources to process the request.

          • INTERNAL_SERVICE_EXCEPTION - An internal service error has occurred.

          • CANCELLED - A user recoverable error has occurred.

      • changesetLabels (dict) –

        Tags associated with the changeset.

        • (string) –

          • (string) –

      • updatesChangesetId (string) –

        Unique identifier of the changeset that is updated.

      • updatedByChangesetId (string) –

        Unique identifier of the changeset that is updated a changeset.

Exceptions

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters:
  • ClientMethod (string) – The client method to presign for

  • Params (dict) – The parameters normally passed to ClientMethod.

  • ExpiresIn (int) – The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)

  • HttpMethod (string) – The http method to use on the generated url. By default, the http method is whatever is used in the method’s model.

Returns:

The presigned url

get_paginator(operation_name)

Create a paginator for an operation.

Parameters:

operation_name (string) – The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you’d normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").

Raises:

OperationNotPageableError – Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.

Return type:

L{botocore.paginate.Paginator}

Returns:

A paginator object.

get_programmatic_access_credentials(**kwargs)

Request programmatic credentials to use with Habanero SDK.

See also: AWS API Documentation

Request Syntax

response = client.get_programmatic_access_credentials(
    durationInMinutes=123,
    environmentId='string'
)
Parameters:
  • durationInMinutes (integer) – The time duration in which the credentials remain valid.

  • environmentId (string) –

    [REQUIRED]

    The habanero environment identifier.

Return type:

dict

Returns:

Response Syntax

{
    'credentials': {
        'accessKeyId': 'string',
        'secretAccessKey': 'string',
        'sessionToken': 'string'
    },
    'durationInMinutes': 123
}

Response Structure

  • (dict) –

    • credentials (dict) –

      Returns the programmatic credentials.

      • accessKeyId (string) –

        The access key identifier.

      • secretAccessKey (string) –

        The access key.

      • sessionToken (string) –

        The session token.

    • durationInMinutes (integer) –

      Returns the duration in which the credentials will remain valid.

Exceptions

get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters:

waiter_name (str) – The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.

Returns:

The specified waiter object.

Return type:

botocore.waiter.Waiter

get_working_location(**kwargs)

A temporary Amazon S3 location to copy your files from a source location to stage or use as a scratch space in Habanero notebook.

See also: AWS API Documentation

Request Syntax

response = client.get_working_location(
    locationType='INGESTION'|'SAGEMAKER'
)
Parameters:

locationType (string) –

Specify the type of the working location.

  • SAGEMAKER - Use the Amazon S3 location as a temporary location to store data content when working with FinSpace Notebooks that run on SageMaker studio.

  • INGESTION - Use the Amazon S3 location as a staging location to copy your data content and then use the location with the changeset creation operation.

Return type:

dict

Returns:

Response Syntax

{
    's3Uri': 'string',
    's3Path': 'string',
    's3Bucket': 'string'
}

Response Structure

  • (dict) –

    • s3Uri (string) –

      Returns the Amazon S3 URI for the working location.

    • s3Path (string) –

      Returns the Amazon S3 Path for the working location.

    • s3Bucket (string) –

      Returns the Amazon S3 bucket name for the working location.

Exceptions

Client Exceptions

Client exceptions are available on a client instance via the exceptions property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.

The available client exceptions are:

class FinSpaceData.Client.exceptions.AccessDeniedException

You do not have sufficient access to perform this action.

Example

try:
  ...
except client.exceptions.AccessDeniedException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    You do not have sufficient access to perform this action.

    • message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class FinSpaceData.Client.exceptions.InternalServerException

The request processing has failed because of an unknown error, exception or failure.

Example

try:
  ...
except client.exceptions.InternalServerException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    The request processing has failed because of an unknown error, exception or failure.

    • message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class FinSpaceData.Client.exceptions.ResourceNotFoundException

One or more resources can’t be found.

Example

try:
  ...
except client.exceptions.ResourceNotFoundException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    One or more resources can’t be found.

    • message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class FinSpaceData.Client.exceptions.ThrottlingException

The request was denied due to request throttling.

Example

try:
  ...
except client.exceptions.ThrottlingException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{}

Structure

  • (dict) –

    The request was denied due to request throttling.

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class FinSpaceData.Client.exceptions.ValidationException

The input fails to satisfy the constraints specified by an AWS service.

Example

try:
  ...
except client.exceptions.ValidationException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    The input fails to satisfy the constraints specified by an AWS service.

    • message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

Paginators

The available paginators are: