gifted-shampoo-74550
04/10/2025, 3:27 PMindex
attr of a foreach step is guaranteed to have the same ordering as the iterable that is passed to foreach
? I see "This property returns the zero based index of the current task" in the docs but didn't want to assume that the ordering is guaranteed even in cloud environments and such.
2. I noticed that some cards in one of my flows were not rendering in the UI; when trying to load them with the API after the fact, I see the result below. I assume this is probably because I tried to put too many figures (probably inside a loop), etc. into the card? If so, are there any rules of thumb for what is a reasonable amount of things for a card? Any way to know in advance whether it's going to be too much?
from metaflow.cards import get_cards
cards = get_cards('FooTask')
cards[0].get()
# Javascript Error: Maximum call stack size exceeded
square-wire-39606
04/10/2025, 8:26 PMgifted-shampoo-74550
04/11/2025, 12:13 PM[
{'a': 1, 'b': 2},
{'a': 3, 'b": 4},
]
and I want to fanout across those params. For each task in the fanout, I want to write results to a unique location (say on s3), and a convenient one for bookkeeping would be the list index (i
) of the parameter set, e.g.
<s3://foo/bar/params={i}/>
I could of course handle this manually (current approach is to add a _index
key to the param set when I load the config), or give a unique name to each element in the list or something. If the index
attr had this kind of guarantee, that would be nice, but certainly not necessary (I know parallelization can make it hard to make these sorts of guarantees). Thanks for the clarification!gifted-shampoo-74550
04/19/2025, 11:23 AMImages, as well as all other content, are embedded in the card itself so it is a good idea the keep their total size under 10MB or so.