https://dagster.io/ logo
#ask-community
Title
# ask-community
l

Liam Pieri

07/27/2023, 3:48 PM
Creation of my metadata is failing
Copy code
metadata = {
            "num_failed_chats": <http://MetadataValue.int|MetadataValue.int>(len(failed_chat_ids)),
            "error_codes": MetadataValue.table(
                records=[TableRecord(code=int(code), count=int(count))
                         for code, count in count_codes.items()],
                schema=TableSchema(
                    columns=[
                        TableColumn(name="code", type="int"),
                        TableColumn(name="count", type="int")
                    ]
                )
            )
        }
is returning
Copy code
TypeError: TableRecord.__new__() got an unexpected keyword argument 'code'
🤖 1
z

Zach

07/27/2023, 3:59 PM
Looking at the source for
TableRecord
it looks like it only takes a
data
parameter which is supposed to be a dict - you might try something like
TableRecord(data={"code": int(code), "count": int(count)})
l

Liam Pieri

07/27/2023, 4:35 PM
Thanks for peeping that,
Works +1
🎉 1