CORE-000305 crashes ("argument of type 'float' is not iterable") when --DUR is empty on some records

Open Beginner friendly
#1,885 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
pandas, python

Research direction

Start with DataframeType.contains in check_operators/dataframe_operators.py and trace how it calls vectorized_is_in for empty values. Use the attached sample data and CLI command to reproduce CORE-000305, then check the rule execution result for rows with empty TEDUR. Done means validation completes without an exception and the P28D value is not reported as negative.

Written by the indexing model from the issue text.

Description

question
Standard

CDISC SDTM/SDTMIG

Reference Rule ID(s)

FB4005

Conformance Rule ID(s) (if published in CORE)

CORE-000305

JIRA Ticket

https://jira.cdisc.org/projects/CORERULES/issues/CORERULES-

CLI Command Used (if applicable)

python core.py validate -s sdtmig -v 3-4 -ct sdtmct-2026-03-27 -d issue4_core_000305 -r CORE-000305 -of JSON

Rule YAML
Check:
  all:
    - name: --DUR
      operator: non_empty
    - name: --DUR
      operator: contains
      value: "-"
Attach any sample test data file(s)

issue4_core_000305.zip issue4_core_000305/te.json and dm.json (attached zip). TE has 4 elements: TEDUR = P28D for the first, empty for the other three (no fixed length).

Attach any output report and/or log file(s)

CORE-000305 TE rule execution error - An unknown exception has occurred
argument of type 'float' is not iterable

Expected output

No issue. TEDUR is permissible and can be empty when an element has no planned duration. The only value given (P28D) is not negative.

Any Additional Information

The rule crashes because some TEDUR values are empty. The "contains" check runs on every row, including the empty ones. Empty values are read as NaN (a number), and checking whether "-" is inside a number raises the error.

Likely fix: treat empty values as "does not contain", or only run the contains check on rows that pass non_empty. Code location: DataframeType.contains in check_operators/dataframe_operators.py (around line 600), via vectorized_is_in.

This will affect any --DUR variable that is only partly filled, which is common.

Dominant language
Python
Stars
125
Forks
50
Avg merge
7h 40m
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cdisc-org/cdisc-rules-engine

All issues in cdisc-org/cdisc-rules-engine

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.