What's the proper way to pass a list to a solid in...
# announcements
p
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
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
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
that should be fine
what error do you get?
p
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
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
Copy code
solids:
  solid_name:
    inputs:
      input_name:
        - value: actual_value
        - value: actual_other_value
Appears to have worked! Thanks @alex
a
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
yep, makes sense
a
whats the inner type out of curiosity ?
p
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
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
this has annoyed me enough that I parse lists of strings from a single string value inside the solid