is this relevant- can I override a serializer task...
# ask-community
m
is this relevant- can I override a serializer task param for numpy arrays? https://github.com/PrefectHQ/prefect/issues/2639#issuecomment-635002663
a
good question, you may need to build a custom serializer e.g. NumpyArraySerializer and pass it there… I will check
So there is a PandasSerializer and it allows to pass an arbitrary file type analogically to Pandas dataframe’s “to_XYZ” method e.g.
<http://df.to|df.to>_csv()
,
<http://df.to|df.to>_parquet()
, etc. And there is a “to_numpy” method: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_numpy.html Not sure if this will work with numpy, but perhaps it would be worth exploring?
k
You can make your own serializer. The JSON one is very easy to follow (and the PickleSerializer also)
m