Closed jtcohen6 closed 2 years ago
@jtcohen6 I added the new arg language, it is an optional one, so not a breaking change for anythin.
But we could also just let them use the existing one name
without adding a new arg, I can make sure that name is passed to where we create a FileBlock
, and as long as that name has the correct ending .py
, the rest will work.
Either way works from my perspective, just want to see if you have any preference
Gonna stay with the current approach after talking on slack
The
compile_sql
method should accept alanguage
argument, with two valid options:("sql", "python")
. (We should do the same things forrun_sql
, for consistency.)I think this would require a change to
RPCExecParameters
:https://github.com/dbt-labs/dbt-rpc/blob/b45d09e487fedb1b12fd3214081e593d52332bb4/dbt_rpc/contracts/rpc.py#L50-L54
If the argument is provided, we should (somewhere) set the
ModelLanguage
attribute of the RPC node to be the language provided. That should be enough for it to be compiled properly here indbt-core
.In order for this to not be a breaking change, when running with earlier versions of
dbt-core
(<1.3), we might need to check if the nodehasattr
for language already. If it does need to be a breaking change, we'll just bumpdbt-rpc
to minor version 0.2.0.We shouldn't go through the trouble of renaming and aliasing these methods because
dbt-rpc
is soon to be deprecated.