https://dagster.io/ logo
p

Paul Wyatt

07/31/2020, 5:39 PM
What's the proper way to pass a list to a solid in a preset? I have solid
datasplit_y
with an argument
id_cols
that takes a list of strings. All of the below have failed: 1
Copy code
datasplit_y:
    inputs:
      id_cols: 
        - user_id
        - program_day
2
Copy code
datasplit_y:
    inputs:
      id_cols:
        value:
          - user_id
          - program_day
3
Copy code
datasplit_y:
    inputs:
      id_cols: [user_id, program_day]
4
Copy code
datasplit_y:
    inputs:
      id_cols: ['user_id', 'program_day']
5
Copy code
datasplit_y:
    inputs:
      id_cols: 
        value: ['user_id', 'program_day']
6
Copy code
datasplit_y:
    inputs:
      id_cols: 
        value: ['user_id', 'program_day']
7
Copy code
datasplit_y:
    inputs:
      id_cols: 
        value: "['user_id', 'program_day']"
8
Copy code
datasplit_y:
    inputs:
      id_cols: 
        value: "[user_id, program_day]"
Clearly I'm throwing hail-marys at this point. Any advice?
a

alex

07/31/2020, 5:41 PM
in yaml? I belive it looks like
Copy code
solids:
  solid_name:
    inputs:
      input_name:
        - value
        - value
the input may need to be typed as
List
for it to work, you may be running in to issues if you are just using default
Any
p

Paul Wyatt

07/31/2020, 5:46 PM
I've tried that form, and it is typed as
List
. Does it matter that list is from the core library's
typing
and not from Dagster?
a

alex

07/31/2020, 5:48 PM
that should be fine
what error do you get?
p

Paul Wyatt

07/31/2020, 5:48 PM
When it's in the form you suggested I get error:
Value selector for type a path root:solids:datasplit_y:inputs:id_cols[0] must be a dict
and then the same error but with
id_cols[1]
when I try any of the other forms it gives me the expected error of
Value at path oot:solids:datasplit_y:inputs:id_cols must be a list
We're on Dagster 0.8.8 if that's relevant
a

alex

07/31/2020, 5:51 PM
ideas:
Copy code
solids:
  solid_name:
    inputs:
      input_name: [x, y, z]
Copy code
solids:
  solid_name:
    inputs:
      input_name:
        - value: actual_value
        - value: actual_other_value
p

Paul Wyatt

07/31/2020, 5:53 PM
Copy code
solids:
  solid_name:
    inputs:
      input_name:
        - value: actual_value
        - value: actual_other_value
Appears to have worked! Thanks @alex
a

alex

07/31/2020, 5:53 PM
ya its a bit annoying to have to key
value
but thats how we distinguish between the direct value vs passing like a file path to go read the value from
p

Paul Wyatt

07/31/2020, 5:53 PM
yep, makes sense
a

alex

07/31/2020, 5:54 PM
whats the inner type out of curiosity ?
p

Paul Wyatt

07/31/2020, 5:54 PM
just strings
It's a list of columns within a dataframe to be treated as ids. It's a list so we can dynamically build models at different levels (e.g. person for some cases, person-day for others, person-day-action for still others)
a

alex

07/31/2020, 6:06 PM
kk i think its a bug that we don’t handle the direct values as the list - we make that work in the singular case so i think its just an issue in the list handler
c

Cagatay K

08/04/2020, 2:17 PM
this has annoyed me enough that I parse lists of strings from a single string value inside the solid