|
8 | 8 | import sys
|
9 | 9 | import time
|
10 | 10 | import typing as t
|
| 11 | +import warnings |
11 | 12 | from importlib import metadata
|
12 | 13 | from pathlib import Path, PurePath
|
13 | 14 | from types import MappingProxyType
|
|
22 | 23 | )
|
23 | 24 | from singer_sdk.exceptions import ConfigValidationError
|
24 | 25 | from singer_sdk.helpers._classproperty import classproperty
|
| 26 | +from singer_sdk.helpers._compat import SingerSDKDeprecationWarning |
25 | 27 | from singer_sdk.helpers._secrets import SecretString, is_common_secret_key
|
26 | 28 | from singer_sdk.helpers._util import read_json_file
|
27 | 29 | from singer_sdk.helpers.capabilities import (
|
@@ -144,12 +146,24 @@ def __init__(
|
144 | 146 | config_dict = {}
|
145 | 147 | elif isinstance(config, (str, PurePath)):
|
146 | 148 | config_dict = read_json_file(config)
|
| 149 | + warnings.warn( |
| 150 | + "Passsing a config file path is deprecated. Please pass the config " |
| 151 | + "as a dictionary instead.", |
| 152 | + SingerSDKDeprecationWarning, |
| 153 | + stacklevel=2, |
| 154 | + ) |
147 | 155 | elif isinstance(config, list):
|
148 | 156 | config_dict = {}
|
149 | 157 | for config_path in config:
|
150 | 158 | # Read each config file sequentially. Settings from files later in the
|
151 | 159 | # list will override those of earlier ones.
|
152 | 160 | config_dict.update(read_json_file(config_path))
|
| 161 | + warnings.warn( |
| 162 | + "Passsing a list of config file paths is deprecated. Please pass the " |
| 163 | + "config as a dictionary instead.", |
| 164 | + SingerSDKDeprecationWarning, |
| 165 | + stacklevel=2, |
| 166 | + ) |
153 | 167 | elif isinstance(config, dict):
|
154 | 168 | config_dict = config
|
155 | 169 | else:
|
|
0 commit comments