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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fabric_user_data_functions-0.1.81rc0.tar.gz
.
File metadata
- Download URL: fabric_user_data_functions-0.1.81rc0.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d38d073df18d719aeffd18153f63a6ad520f69528306561790400e78f14232f |
|
MD5 | 354d4e079b45a4c3caa86e7521c115cb |
|
BLAKE2b-256 | 449ce584e46e2106043030e16d7542063ca044a29662c27c7c98a7da6e17a269 |
File details
Details for the file fabric_user_data_functions-0.1.81rc0-py3-none-any.whl
.
File metadata
- Download URL: fabric_user_data_functions-0.1.81rc0-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 113de0b8d4787ced63437f9c925196d8d1031fe87ba05175190198ba3044177e |
|
MD5 | 624b4a8f848133f7959352f48c2740fd |
|
BLAKE2b-256 | ca14000e74622fe04a66f80bab81cd9639d95e7c91745256a163725a2715633e |