https://flyte.org logo
#flytekit
Title
# flytekit
r

Rahul Mehta

12/07/2022, 3:40 PM
What is the purpose of
tag
in the flytekit.models
Binary
literal?
Copy code
class Binary(_common.FlyteIdlEntity):
    def __init__(self, value, tag):
        """
        :param bytes value:
        :param Text tag:
        """
        self._value = value
        self._tag = tag
k

Ketan (kumare3)

12/07/2022, 3:41 PM
Idea was to keep things like the protobuf message name etc in it
r

Rahul Mehta

12/07/2022, 3:41 PM
For context am writing a TypeTransformer where for certain reasons we want to pickle a dataclass rather than serializing it to JSON and was curious what to specify for that value
Ah ok, thank you - does the value of
tag
matter in the case I'm describing? Sounds like the answer is no
k

Ketan (kumare3)

12/07/2022, 3:42 PM
So yes you can keep any meta information as it will be used by the compiler to statically verify
It is optional, if you put the class id it should work nicely
r

Rahul Mehta

12/07/2022, 3:43 PM
Cool, that's what I figured, thanks @Ketan (kumare3). Will use the fully-qualified class name as the tag.
69 Views