1
0
mirror of synced 2026-01-01 18:02:53 -05:00
Files
airbyte/airbyte-cdk/python/airbyte_cdk/sources/declarative/interpolation/interpolation.py
Alexandre Girard a3ff80c179 [low-code-connectors] Disable parse-time interpolation in favor of runtime-only (#14923)
* abstract auth token

* basichttp

* remove prints

* docstrings

* get rid of parse-time interpolation

* always pass options through

* delete print

* delete misleading comment

* delete note

* reset

* pass down options

* delete duplicate file

* missing test

* refactor test

* rename to '$options'

* rename to ''

* interpolatedauth

* fix tests

* fix

* docstrings

* update docstring

* docstring

* update docstring

* remove extra field

* undo

* rename to runtime_parameters

* docstring

* update

* / -> *

* update template

* rename to options

* Add examples

* update docstring

* Update test

* newlines

* rename kwargs to options

* options init param

* delete duplicate line

* type hints

* update docstring

* Revert "delete duplicate line"

This reverts commit 4255d5b346.

* delete duplicate code from bad merge

* rename file

* bump cdk version
2022-07-28 08:57:17 -07:00

28 lines
929 B
Python

#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from abc import ABC, abstractmethod
from typing import Optional
from airbyte_cdk.sources.declarative.types import Config
class Interpolation(ABC):
"""
Strategy for evaluating the interpolated value of a string at runtime using Jinja.
"""
@abstractmethod
def eval(self, input_str: str, config: Config, default: Optional[str] = None, **additional_options):
"""
Interpolates the input string using the config, and additional options passed as parameter.
:param input_str: The string to interpolate
:param config: The user-provided configuration as specified by the source's spec
:param default: Default value to return if the evaluation returns an empty string
:param additional_options: Optional parameters used for interpolation
:return: The interpolated string
"""
pass