dbt-core icon indicating copy to clipboard operation
dbt-core copied to clipboard

[CT-2652] Remove "Replaceable" class usage as much as possible

Open gshank opened this issue 2 years ago • 4 comments

We pull in a Replaceable class which contains a "replace" method in a lot of our classes. This method is designed to replace the current object with a newly constructed one based on kwargs, and is in general not a very good idea. If we want to replace a current object it would be better to be a lot more explicit and intentional about what's happening.

Remove the usage Replaceable class where it's found in dbt-core, look for breakage, and determine if we really need to do this or could just update the current object.

gshank avatar Jun 06 '23 15:06 gshank

Need to check that this isn't used in adapters as well. Might be easier/better to move it to the dbtMixin class.

emmyoop avatar Jun 12 '23 16:06 emmyoop

Added this issue to the 'Stabilize External Interfaces' Epic under Artifacts since it plays nicely with our efforts to make the base artifact dataclasses 'plain old data objects'

MichelleArk avatar Jan 29 '24 21:01 MichelleArk

Updated this issue to be scoped to the usage of Replaceable in dbt-core, since it is now defined in dbt-common. Its full deletion can be done as a separate issue in dbt-common, once dbt-adapters has gone through the same exercise.

MichelleArk avatar Feb 13 '24 21:02 MichelleArk

An initial pass was taken here: https://github.com/dbt-labs/dbt-core/pull/7844 but will likely need to start from scratch given the artifact + dbt-common refactors since it was initially spiked.

MichelleArk avatar Feb 13 '24 21:02 MichelleArk