@@ -60,7 +60,6 @@ class Profile(HasCredentials):
60
60
credentials : Credentials
61
61
profile_env_vars : Dict [str , Any ]
62
62
log_cache_events : bool
63
- secondary_profiles : Dict [str , "Profile" ]
64
63
65
64
def __init__ (
66
65
self ,
@@ -80,7 +79,6 @@ def __init__(
80
79
self .log_cache_events = (
81
80
get_flags ().LOG_CACHE_EVENTS
82
81
) # never available on init, set for adapter instantiation via AdapterRequiredConfig
83
- self .secondary_profiles = {}
84
82
85
83
def to_profile_info (self , serialize_credentials : bool = False ) -> Dict [str , Any ]:
86
84
"""Unlike to_project_config, this dict is not a mirror of any existing
@@ -259,7 +257,6 @@ def render_profile(
259
257
profile_name : str ,
260
258
target_override : Optional [str ],
261
259
renderer : ProfileRenderer ,
262
- is_secondary : bool = False ,
263
260
) -> Tuple [str , Dict [str , Any ]]:
264
261
"""This is a containment zone for the hateful way we're rendering
265
262
profiles.
@@ -276,12 +273,6 @@ def render_profile(
276
273
elif "target" in raw_profile :
277
274
# render the target if it was parsed from yaml
278
275
target_name = renderer .render_value (raw_profile ["target" ])
279
- elif is_secondary and len (raw_profile .get ("outputs" , [])) == 1 :
280
- # if we only have one target, we can infer the target name
281
- # currently, this is only used for secondary profiles
282
- target_name = next (iter (raw_profile ["outputs" ]))
283
- # the event name is slightly misleading, but the message indicates that we inferred the target name for a profile
284
- fire_event (MissingProfileTarget (profile_name = profile_name , target_name = target_name ))
285
276
else :
286
277
target_name = "default"
287
278
fire_event (MissingProfileTarget (profile_name = profile_name , target_name = target_name ))
@@ -302,7 +293,6 @@ def from_raw_profile_info(
302
293
renderer : ProfileRenderer ,
303
294
target_override : Optional [str ] = None ,
304
295
threads_override : Optional [int ] = None ,
305
- is_secondary : bool = False ,
306
296
) -> "Profile" :
307
297
"""Create a profile from its raw profile information.
308
298
@@ -322,14 +312,9 @@ def from_raw_profile_info(
322
312
"""
323
313
# TODO: should it be, and the values coerced to bool?
324
314
target_name , profile_data = cls .render_profile (
325
- raw_profile , profile_name , target_override , renderer , is_secondary = is_secondary
315
+ raw_profile , profile_name , target_override , renderer
326
316
)
327
317
328
- if is_secondary and "secondary_profiles" in profile_data :
329
- raise DbtProfileError (
330
- f"Secondary profile '{ profile_name } ' cannot have nested secondary profiles"
331
- )
332
-
333
318
# valid connections never include the number of threads, but it's
334
319
# stored on a per-connection level in the raw configs
335
320
threads = profile_data .pop ("threads" , DEFAULT_THREADS )
@@ -340,31 +325,13 @@ def from_raw_profile_info(
340
325
profile_data , profile_name , target_name
341
326
)
342
327
343
- profile = cls .from_credentials (
328
+ return cls .from_credentials (
344
329
credentials = credentials ,
345
330
profile_name = profile_name ,
346
331
target_name = target_name ,
347
332
threads = threads ,
348
333
)
349
334
350
- for p in profile_data .pop ("secondary_profiles" , []):
351
- for secondary_profile_name , secondary_raw_profile in p .items ():
352
- if secondary_profile_name in profile .secondary_profiles :
353
- raise DbtProfileError (
354
- f"Secondary profile '{ secondary_profile_name } ' is already defined"
355
- )
356
-
357
- profile .secondary_profiles [secondary_profile_name ] = cls .from_raw_profile_info (
358
- secondary_raw_profile ,
359
- secondary_profile_name ,
360
- renderer ,
361
- target_override = target_override ,
362
- threads_override = threads_override ,
363
- is_secondary = True ,
364
- )
365
-
366
- return profile
367
-
368
335
@classmethod
369
336
def from_raw_profiles (
370
337
cls ,
0 commit comments