Skip to main content

Set of gooddata-flight-server methods to host custom functions for GoodData Cloud

Project description

GoodData FlexFun

The GoodData FlexFun package is a GoodData Flight Server-compatible extension that provides a framework for hosting custom pluggable functions called FlexFuns. These can be used to act as a dataset for GoodData FlightRPC data sources.

What is a FlexFun?

In essence, FlexFun is a class that provides a set of methods that can be called by the GoodData Cloud when data is requested from the corresponding FlightRPC data source dataset.

Each FlexFun provides a name used to identify the FlexFun in the GoodData Cloud. FlexFuns can provide a set of metadata that can further influence when and how they are called by GoodData Cloud. They also provide a schema (defined in terms of pyarrow.Schema) that describes the shape of data that the FlexFun can provide. Finally, they provide a set of methods that can be called to provide data in response to queries:

  • call - called to provide data in response to a query
  • cancel - called to cancel a query if GoodData Cloud decides to stop requesting data (e.g. if there is a timeout)
  • on_load - called when the FlexFun is created before any call or cancel methods are called

Getting Started using the FlexFun Template

The easiest way to get started writing FlexFuns is to use the template repository. It provides a simple example of a FlexFun that can be used as a starting point for your own FlexFun with all the necessary infrastructure in place. It also has a README that explains how to get started with the template and some general tips on how to write FlexFuns.

Getting started using the FlexFun package directly

Install the package alongside the gooddata-flight-server using pip:

pip install gooddata-flight-server gooddata-flexfun

Next, update the GoodData Flight Server configuration to load the FlexFun methods.

[flexfun]

# specify one or more modules that contain your FlexFun implementations
#
functions = [
    "flexfun.your_function"
]

Then when running the GoodData Flight Server, use the --methods-provider option to load the FlexFun methods. For example:

#!/bin/bash

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SERVER_CMD="${SCRIPT_DIR}/.venv/bin/gooddata-flight-server"

export PYTHONPATH="${SCRIPT_DIR}/src"
export CONFIG_ENV="${1:-dev}"

$SERVER_CMD start \
              --methods-provider gooddata_flexfun \
              --config \
                config/${CONFIG_ENV}.server.toml \
                config/flexfun.config.toml \
              --logging-config config/default.logging.ini \
              --dev-log

This will start the GoodData Flight Server with the FlexFun methods loaded.

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

gooddata_flexfun-1.28.1.dev3.tar.gz (46.6 kB view details)

Uploaded Source

Built Distribution

gooddata_flexfun-1.28.1.dev3-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file gooddata_flexfun-1.28.1.dev3.tar.gz.

File metadata

File hashes

Hashes for gooddata_flexfun-1.28.1.dev3.tar.gz
Algorithm Hash digest
SHA256 6f51a81aa0b19303bd30880a5e1b5b2b903af0c7eda32131d51185d73a193a1e
MD5 7dbd1f341908b0bc05b9590d67fd2a61
BLAKE2b-256 bc1c363f30fd3c23a7c233e74ac0265032d62fb09c3e3cc6c2a401aeac64406d

See more details on using hashes here.

File details

Details for the file gooddata_flexfun-1.28.1.dev3-py3-none-any.whl.

File metadata

File hashes

Hashes for gooddata_flexfun-1.28.1.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 995023c620b0c9175ecb23630af49baca488c29b94afdf70619cc0c1d61ce7e5
MD5 da47f3e2063ce06e6d571a7be2cd906b
BLAKE2b-256 28a11d69836390744267a258b0c7d34302c86e321c4374180214b8b59be7e1f0

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