1
0
mirror of synced 2026-01-02 12:02:47 -05:00
Files
airbyte/airbyte-cdk/python/airbyte_cdk/sources/declarative/interpolation/interpolated_string.py
Marcos Marx dca2256a7c Bump 2022 license version (#13233)
* Bump year in license short to 2022

* remove protocol from cdk
2022-05-26 15:00:42 -03:00

18 lines
519 B
Python

#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from typing import Optional
from airbyte_cdk.sources.declarative.interpolation.jinja import JinjaInterpolation
class InterpolatedString:
def __init__(self, string: str, default: Optional[str] = None):
self._string = string
self._default = default or string
self._interpolation = JinjaInterpolation()
def eval(self, config, **kwargs):
return self._interpolation.eval(self._string, config, self._default, **kwargs)