* 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
28 lines
929 B
Python
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
|