Skip to main content

This package contains bindings and middle ware required for fabric functions built on python.

Project description

Fabric Functions Python Worker

Introduction

This project contains the necessary bindings and middleware we can register on a python function in order to receive fabric data from our worker extension.

Fabric Item Binding

By importing the fabric_item_input binding, the user can add a new attribute to their fabric function. This input has the same properties as the FabricItem attribute and binding from the host extension and will pass down to the worker the information to create a FabricItem:

class FabricItem:
    def __init__(self, aliasName: str, connectionString: str, fabricItemType: ItemType, endpoints: typing.Dict[str, Endpoint]):
        self.__aliasName = aliasName
        self.__connectionString = connectionString
        self.__fabricItemType = fabricItemType
        self.__endpoints = endpoints

where Endpoint is a class containing a string ConnectionString and a string AccessToken

Depending on the itemType specified in the input binding, we can map the item type to either the default FabricItem, a FabricSqlConnection (for SQL or Datamarts), or a FabricLakeHouseFilesClient (for LakeHouse files).

@fabric_item_input(app, argName="myDatamart", alias="MyDatamart", item_type=ItemType.Datamart)
@app.route(route="hello_fabric")
def hello_fabric(req: func.HttpRequest, myDatamart: FabricSqlConnection) -> func.HttpResponse:
    logging.info('Python HTTP trigger function processed a request.')
    conn = myDatamart.connect()

    # Use pyodbc connection

    currentTime = datetime.datetime.now()

    return func.HttpResponse(f"Hello Fabric. The current time is {currentTime.time()}.")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fabric_user_data_functions-0.1.56rc0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file fabric_user_data_functions-0.1.56rc0.tar.gz.

File metadata

File hashes

Hashes for fabric_user_data_functions-0.1.56rc0.tar.gz
Algorithm Hash digest
SHA256 624245914f82131b5c1b3829bc67e6b9f1cd493e9670cee4733f04cd23e53ef0
MD5 3dae5fb080772355e5914a991297b74b
BLAKE2b-256 477a0f852c79ac2d6a0396f5235fbcfbe248ddfb888654d3c96d8ff9bcd9a583

See more details on using hashes here.

File details

Details for the file fabric_user_data_functions-0.1.56rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for fabric_user_data_functions-0.1.56rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 70a7e47b4feac7387c40e7f1f3c395cadd44a2badff0d2b2a82391f15ee4ebd9
MD5 3f2fddb9025ca34177e8b10c14f7ed66
BLAKE2b-256 83745577e75718052ea5c3f18209ddab4cc0a88ccf00a1eb2d2ce8438b8faeb5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page