You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using fire on a main function that returns a ~datasets.Dataset object. When running from cli, I get the help screen for ~datasets.Dataset rather than the __str__ implementation (likely inherited from a parent class -- haven't looked).
Reproducible example
fromdatasetsimportDatasetimportfiredefmain():
# Create a simple datasetdataset=Dataset.from_dict({"a": [1, 2, 3], "b": [4, 5, 6]})
returndatasetif__name__=="__main__":
fire.Fire(main)
# This works but I feel shouldn't be necessary:# def custom_serializer(obj: object) -> str:# if hasattr(obj, "__str__"):# return str(obj)# else:# return ""# fire.Fire(main, serialize=custom_serializer)
The text was updated successfully, but these errors were encountered:
Hi,
I am using fire on a
main
function that returns a~datasets.Dataset
object. When running from cli, I get the help screen for~datasets.Dataset
rather than the__str__
implementation (likely inherited from a parent class -- haven't looked).Reproducible example
The text was updated successfully, but these errors were encountered: