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

Bugfix/partitioning #312

Merged
merged 2 commits into from
Jul 25, 2023
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
4 changes: 2 additions & 2 deletions src/fondant/data_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def partition_written_dataframe(self, dataframe: dd.DataFrame) -> dd.DataFrame:
elif self.output_partition_size is None:
dataframe = dataframe.repartition(partition_size="250MB")
logger.info(
f"Repartitioning the written data such that the size per partition is approx."
f" {self.output_partition_size}. (Automatic repartitioning)",
"Repartitioning the written data such that the size per partition is approx."
" 250MB. (Automatic repartitioning)",
)
else:
msg = (
Expand Down
4 changes: 2 additions & 2 deletions src/fondant/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class Field(t.NamedTuple):

def validate_partition_number(arg_value):
if arg_value in ["disable", None, "None"]:
return arg_value
return arg_value if arg_value != "None" else None
try:
return int(arg_value)
except ValueError:
Expand All @@ -169,7 +169,7 @@ def validate_partition_number(arg_value):

def validate_partition_size(arg_value):
if arg_value in ["disable", None, "None"]:
return arg_value
return arg_value if arg_value != "None" else None

file_size_pattern = r"^\d+(?:\.\d+)?(?:KB|MB|GB|TB)$"
if not bool(re.match(file_size_pattern, arg_value, re.I)):
Expand Down