The problem I’m having
Unable to run a dbt run with multiple variables with --vars option. passed as serialized json
I am trying execute the below command.
dbt run --select path:/var/folders/hx/cczdvpr10r18w09j6wyn6_jm0000gn/T/iaq2a8ad/dbt/tenant_jdespr/models/segmentation_input --vars '{"model_path": "models/segmentation_input", "sdate_fld": "sdate", "sqty_fld": "sqty", "item_tab": "marts_material_spr", "sales_hist_tab": "marts_sales_history_engine_spr", "gfu_item": "item", "gfu_loc": "loc", "gfu_cust": "cust", "seg_item": "item", "seg_loc": "loc", "seg_cust": "cust", "model_freq": "week", "generate_seg_param_age": true, "age_hist_length": 200, "age_hist_length_unit": "weeks", "age_param_groups": [{"AGE_NEW": [0, 24]}, {"AGE_SHORT": [24, 52]}, {"AGE_MEDIUM": [52, 104]}, {"AGE_LONG": [104, "INF"]}], "generate_seg_param_velocity": true, "velocity_hist_length": 200, "velocity_hist_length_unit": "weeks", "velocity_param_groups": [{"VELOCITY_A": [0, 80]}, {"VELOCITY_B": [80, 90]}, {"VELOCITY_C": [90, 95]}, {"VELOCITY_D": [95, 99]}, {"VELOCITY_E": [99, 100]}], "generate_seg_param_shiprate": true, "shiprate_hist_length": 52, "shiprate_hist_length_unit": "weeks", "shiprate_param_groups": [{"SHIPRATE_E": [0, 5]}, {"SHIPRATE_D": [5, 25]}, {"SHIPRATE_C": [25, 50]}, {"SHIPRATE_B": [50, 75]}, {"SHIPRATE_A": [75, 100]}], "tdate": "2023-08-14"}' --profiles-dir /var/folders/hx/cczdvpr10r18w09j6wyn6_jm0000gn/T/iaq2a8ad/dbt/profiles --project-dir /var/folders/hx/cczdvpr10r18w09j6wyn6_jm0000gn/T/iaq2a8ad/dbt/tenant_jdespr
What I’ve already tried
Some example code or error messages
11:24:46 Found 42 models, 360 tests, 0 snapshots, 0 analyses, 719 macros, 0 operations, 0 seed files, 9 sources, 0 exposures, 0 metrics
11:24:47 Encountered an error:
Non-relative patterns are unsupported
11:24:47 Traceback (most recent call last):
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/main.py”, line 135, in main
results, succeeded = handle_and_check(args)
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/main.py”, line 198, in handle_and_check
task, res = run_from_args(parsed)
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/main.py”, line 245, in run_from_args
results = task.run()
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/task/runnable.py”, line 453, in run
self._runtime_initialize()
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/task/runnable.py”, line 165, in _runtime_initialize
self.job_queue = self.get_graph_queue()
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/task/runnable.py”, line 158, in get_graph_queue
return selector.get_graph_queue(spec)
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 274, in get_graph_queue
selected_nodes = self.get_selected(spec)
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 265, in get_selected
selected_nodes, indirect_only = self.select_nodes(spec)
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 157, in select_nodes
direct_nodes, indirect_nodes = self.select_nodes_recursively(spec)
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in select_nodes_recursively
bundles = [self.select_nodes_recursively(component) for component in spec]
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in
bundles = [self.select_nodes_recursively(component) for component in spec]
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in select_nodes_recursively
bundles = [self.select_nodes_recursively(component) for component in spec]
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in
bundles = [self.select_nodes_recursively(component) for component in spec]
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in select_nodes_recursively
bundles = [self.select_nodes_recursively(component) for component in spec]
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in
bundles = [self.select_nodes_recursively(component) for component in spec]
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 129, in select_nodes_recursively
direct_nodes, indirect_nodes = self.get_nodes_from_criteria(spec)
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 86, in get_nodes_from_criteria
collected = self.select_included(nodes, spec)
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 72, in select_included
return set(method.search(included_nodes, spec.value))
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector_methods.py”, line 287, in search
paths = set(p.relative_to(root) for p in root.glob(selector))
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/site-packages/dbt/graph/selector_methods.py”, line 287, in
paths = set(p.relative_to(root) for p in root.glob(selector))
File “/Users/darshanr/opt/anaconda3/envs/prefect_garvis/lib/python3.10/pathlib.py”, line 1032, in glob
raise NotImplementedError(“Non-relative patterns are unsupported”)
NotImplementedError: Non-relative patterns are unsupported