Skip to content

Commit

Permalink
Fix validation for job partitioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdoehring committed Aug 20, 2024
1 parent 0d2de3d commit 747f90c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions cdip_connector/core/cdip_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
JOB_COMPLETION_COUNT = int(_job_completion_count) if _job_completion_count is not None else None

# Sanitize task count and index.
if JOB_COMPLETION_INDEX is not None \
and JOB_COMPLETION_COUNT is not None:
if JOB_COMPLETION_COUNT > 1 and JOB_COMPLETION_COUNT > JOB_COMPLETION_INDEX:
# Partitioned
JOB_IS_PARTITIONED = True
else:
if all(item is not None for item in [JOB_COMPLETION_INDEX, JOB_COMPLETION_COUNT]):

if JOB_COMPLETION_INDEX >= JOB_COMPLETION_COUNT:
# Values are set but are not valid.
raise ValueError('JOB_COMPLETION_COUNT must be greater than 1 and greater than JOB_COMPLETION_INDEX')
else:
JOB_IS_PARTITIONED = True

else:
# No partitioning
JOB_IS_PARTITIONED = False
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cdip_connector"
version = "1.5.3"
version = "1.5.4"
description = "SMART Integrate Connector Library"
authors = [
"Rohit Chaudhri <rohitc@vulcan.com>",
Expand Down

0 comments on commit 747f90c

Please sign in to comment.