microsoft / microsoft/promptflow

[Feature Request] Support optional data types

Open
#1,932 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement long-term
Dominant language
Python
Stars
11.2k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.

Based on how we use prompt flow, we sometimes would need to pass optional integers into flows. The reason is that we distinguish between the absence of a number (None) and its default (0). As of today, prompt flow does not support optional integer input types. This can be verified by running:

  • pf flow init --flow foo
  • Change type of the text input to int
  • Change the value of text in data.jsonl to null
  • Run pf run create --flow foo --data foo/data.jsonl --column-mapping text='${data.text}' --stream

Describe the solution you'd like

Prompt flow should support optional data types and with that the ability to express absence of primitive input values.

Describe alternatives you've considered

As a workaround, we're currently expressing absent integers as integers that have no meaning in our context (e.g. -1 for integers that are always expected to be positive).

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the behavior with pf flow init --flow foo, the data.jsonl null value, and pf run create --flow foo --data foo/data.jsonl --column-mapping text='${data.text}' --stream. Then trace flow input type handling and validation to determine how optional primitive types are represented. Done means an optional integer input accepts null while preserving the distinction between absence and a default such as 0, with coverage for the supported optional types.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.