-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add run-operation + snapshot to the RPC server (#1875) #1878
add run-operation + snapshot to the RPC server (#1875) #1878
Conversation
One thing to think about here: Should the method name be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment here about the argument to snapshot
, but otherwise this looks and works super well!
Should the method name be run_operation
I think there's merit to each approach -- I don't feel super strongly either way! Parity with the CLI seems like a stronger argument than parity with other RPC tasks IMO
METHOD_NAME = 'snapshot' | ||
|
||
def set_args(self, params: RPCCompileParameters) -> None: | ||
self.args.models = self._listify(params.models) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the input to snapshot
on the CLI is -s --select
, not --models
- can we update this accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! Ship it
Fixes #1875
snapshot
+run-operation
support.run-operation
:In addition to the defaults of 'task_tags' and 'timeout' there are 2 parameters:
- macro: str (required)
- args: Dict[str, Any] (optional)
As in the CLI version, run operations return a
success
boolean that indicates whether the macro raised an exception or not. They will only return anerror
object if the request itself is somehow wrong. The result returned by the macro is discarded.snapshot
:This has the same arguments as
compile
andrun
. It executes thedbt snapshot
task.Both methods work via
cli_args
.