finos / finos/tracdap

Error saving series with all missing values

Open
#280 0 comments 0 reactions 0 assignees View on GitHub
bug python runtime-python
Dominant language
Java
Stars
55
Forks
18
Avg merge
6h 29m
Merged PRs (30d)
16

Description

## Bug Report

### Steps to Reproduce:
In an IDE using the tracdap runtime try to save a dataFrame as an output of a model:

Create the dataFrame with a column made up completely of missing values:

```
data = {
'INDEX': ['A', 'B', 'C'],
'INDEX_VALUE_DATE': [date, date, date],
'INDEX_VALUE': [pd.NA, pd.NA, pd.NA]
}

df = pd.DataFrame(data)
```

With the schema:

```
field_name,field_type,label,categorical,business_key,format_code
INDEX,STRING,Index name,FALSE,FALSE
INDEX_VALUE_DATE,DATE,Index value date,FALSE,FALSE,"DAY"
INDEX_VALUE,FLOAT,Index value,FALSE,FALSE,"|.|3|||1"
```

### Expected Result:
Data is saved as an output without error.

### Actual Result:
Error occurs

```
raise _ex.EModelExec(msg) from e
tracdap.rt.exceptions.EModelExec: There was an unhandled error in the model: Column 2 named INDEX_VALUE expected length 3 but got length 0
```

### Environment:

Python 3.11
tracdap runtime 0.5.9

### Additional Context:
Saving the data works if one value in the column is not NA.

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named in the report. Reproduce the failure in the Python 3.11 runtime with the shown pandas DataFrame and schema, then trace the output-saving path for the all-NA INDEX_VALUE column. Done means the output saves successfully with three rows, matching the behavior when one value is non-missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.