1
0
mirror of synced 2026-01-01 00:02:54 -05:00
Files
airbyte/airbyte-cdk/python/airbyte_cdk/sources/declarative/interpolation/interpolation.py
Cole Snodgrass 2e099acc52 update headers from 2022 -> 2023 (#22594)
* It's 2023!

* 2022 -> 2023

---------

Co-authored-by: evantahler <evan@airbyte.io>
2023-02-08 13:01:16 -08:00

28 lines
929 B
Python

#
# Copyright (c) 2023 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