Hi - Is there a way to mix serializers? For examp...
# ask-community
i
Hi - Is there a way to mix serializers? For example the default flow result serialization is set to pandas. But there are some tasks in the flow that I would like to pickle.
Copy code
flow.result = LocalResult(
        serializer=PandasSerializer(file_type="csv")
    )
Task to pickle
Copy code
num_clusters = value_count(df)
Thanks in advance
z
Hey @itay livni - you can define a result type per task too. Just pass it to the
@task
decorator
i
@Zanie Hmmm. I thought so, but could not find the appropriate to use in the docs:
Copy code
class prefect.core.task.Task(
name=None, slug=None, tags=None, max_retries=None, retry_delay=None, timeout=None, trigger=None, skip_on_upstream_skip=True, cache_for=None, cache_validator=None, cache_key=None, checkpoint=None, state_handlers=None, on_failure=None, log_stdout=False, result=None, target=None, task_run_name=None, nout=None)
Have a good weekend
z
You'll want to pass a new
LocalResult
To
result
:)
👍 1
b
Hi @Zanie - I just noticed this also, did the serializer kwarg get dropped? Ignore me I was always just using
Result(serializer=..)