Hello, I would like to define a list of similar AP...
# ask-community
r
Hello, I would like to define a list of similar APIs or Databases as a single resource that I can loop over in order to materialize my assets. Most examples shown in the documentation only shows resources as a single set of credentials/API/database. What is the best approach to set a list of credentials/databases/APIs as a resource that will be used by operations or assets ?
s
A resource can be any object, including a list. Would that work for you? config can be structured as a list, as described here: https://docs.dagster.io/_apidocs/config#dagster.ConfigSchema
r
Hello Sandy, Sorry for the late response. I am using the new pythonic way to define nested resources in order to define my list of resources. I am not certain it is a good practice however it seems like resource view is showing value as type "Array.Shape" and value as a JSON array. Will there be an improvement to display this list of credentials with proper key/value display per element in my array ?
s
@ben - mind chiming in here?
b
Hi Lucas, just to make sure, you have a config field on your resource which is a list of credentials. Currently it’s displaying on the resource page as a JSON array, but you’d want it to ideally display as k/v pairs?
This page is still very much in development, so improving config value display is definitely something we’re interested in
r
Hello Sandy, Ben, Yes, clear key/value pairs is indeed what would like to see as a long JSON array is not really readable. It's great to know you are working. I'm looking forward to see a solution to this !