-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Feature] Add an --input-file
option to run-operation
#4139
Comments
wow, what a great idea! maybe this type of macro would then work in dbt cloud |
@edgarrmondragon Thanks for opening! The workaround described in that discourse post makes sense to me. So I sense the real motivation behind this issue as being:
Totally fair; I'd like to see us add better support for the use case. I sense that this falls under the more general-purpose feature of dbt Cloud jobs as code (specifically, YAML). In a future where that's possible, it would also be possible to define the arguments for your run operation in a version-controlled file: # NOTE: this is made up, and does not exist today
jobs:
- name: my_job
execution:
steps:
- dbt run-operation create_pipe --args '{"arg1": "value1", "arg2": ["long", "list", "of", "values"], "arg3": ...}' Or perhaps even: # for demonstration only
jobs:
- name: my_job
execution:
steps:
- name: Run operation to create pipe
subcommand: run-operation
macro_name: create_pipe
args:
arg1: value1
arg2:
- long
- list
- of
- values
arg3: ... @schottj What do you think? Does something like that make sense to you as part of a future initiative? I noticed that your macro is named If you were to define your $ dbt run-operation stage_external_sources --args "select:my_external_source" |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest; add a comment to notify the maintainers. |
Is there an existing feature request for this?
Describe the Feature
The
run-operation
command currently supports a CLI option--args
with a YAML string value. For complex and/or large YAML objects as inputs, passing the whole thing as a string in the CLI is mildly inconvenient. A good alternative for such use cases would be to support an--input-file
option that expects a path to a YAML file.Describe alternatives you've considered
A workaround documented in Discourse is to use Bash's capabilities to pass the contents of the file like:
dbt run-operation create_pipe --args "$(cat path/to/file.yml)"
This works in environments where dbt is directly executed as a shell command, but in dbt Cloud the Bash magic doesn't work.
Who will this benefit?
Users of
run-operation
with complex inputs.Are you interested in contributing this feature?
Yes!
Anything else?
No response
The text was updated successfully, but these errors were encountered: