Closed dweaver33 closed 2 years ago
Hi @dweaver33 ! In the example you gave you're using the get_profile macro instead of print_profile. Also, you're using the source macro which AFAIK doesn't work from the command line.
Try this instead:
dbt run-operation print_profile --args '{"relation_name": "my_table", "database": "my_database", "schema": "my_schema"}'
Let me know if that works!
Ah, ok, that works.
One last question: Any way to put a WHERE clause on the profiler? Like if we wanted to only profile data that meets a certain criteria?
@dweaver33 That's a good question and I haven't thought about that yet. Currently, there's no easy way to put a WHERE clause into the profiling query but adding it should be easy. Basically we'd need to add a where
argument to the get_profile
macro and all the other macros that use it. Would you be interested in contributing? :) I'd be happy to help and answer any questions you may have.
Yeah, I'll give it a shot. I have a decent idea on where to put this, so let me give it a go and submit a PR. In the meantime, I'll open a new issue for tracking.
I can't seem to get the syntax correct for using the
print_profile
macro on command line with a dbt source.I've tried the following:
And several other variations. Any ideas how this would work?