Ruben Vereecken
01/04/2024, 2:36 PMsinger_sdk.exceptions.MapExpressionError: Failed to evaluate simpleeval expressions 1 if company_industry == -1 else company_industry
Thoughts on what looks wrong?
stream_maps:
users:
company_industry: 1 if company_industry == -1 else company_industry
Trying this in a separate REPL using simpleeval
, it works fineRuben Vereecken
01/04/2024, 2:45 PMcompany_industry
is really attributes['company_industry']
. Can I use stream_maps on nested fields?Edgar Ramírez (Arch.dev)
01/04/2024, 2:52 PMcompany_industry: "1 if attributes['company_industry'] == -1 else attributes['company_industry']"
. But note that you can't write back to the nested field you're denesting company_industry
.Ruben Vereecken
01/04/2024, 2:57 PMEdgar Ramírez (Arch.dev)
01/04/2024, 3:57 PMstream_maps:
users:
attributes: "dict([(k, 1 if k == 'company_industry' and v == -1 else v) for k, v in attributes.items()])"
Ruben Vereecken
01/04/2024, 4:54 PM