Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move convert-string into component setup method #871

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/fondant/component/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def __init__(self, **kwargs):
super().__init__()

def setup(self) -> t.Any:
# Don't assume every object is a string
# https://docs.dask.org/en/stable/changelog.html#v2023-7-1
dask.config.set({"dataframe.convert-string": False})
# worker.daemon is set to false because creating a worker process in daemon
# mode is not possible in our docker container setup.
dask.config.set({"distributed.worker.daemon": False})
Expand Down
5 changes: 0 additions & 5 deletions src/fondant/component/data_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import typing as t
from collections import defaultdict

import dask
import dask.dataframe as dd
from dask.diagnostics import ProgressBar
from dask.distributed import Client
Expand Down Expand Up @@ -31,10 +30,6 @@ def __init__(
input_partition_rows: t.Optional[int] = None,
):
super().__init__(manifest=manifest, operation_spec=operation_spec)
# Don't assume every object is a string
# https://docs.dask.org/en/stable/changelog.html#v2023-7-1
dask.config.set({"dataframe.convert-string": False})

self.input_partition_rows = input_partition_rows

def partition_loaded_dataframe(self, dataframe: dd.DataFrame) -> dd.DataFrame:
Expand Down
Loading