Source imports to python functions are coming soon! Initially, we expect python functions to work more like python transforms, where you import the source directly and use it with a requests client, rather than invoking specific webhooks defined in the data connection user interface. Our goal is to provide the maximum flexibility for doing code-based interactive workflows against external systems.
An example of the kind of python function code we expect to support:
import requests
from functions.api import function
@function(sources=["<source_rid>"])
def get_pokemon_types(name: str) -> list[str]:
data = requests.request("GET", f'https://pokeapi.co/api/v2/pokemon/{name}/').json()
return [type_['type']['name'] for type_ in data['types']]
Keep an eye out for documentation and an announcement about this feature in the coming weeks.