microsoft / microsoft/promptflow
[Feature Request] Support optional data types
Nobody has claimed this yet.
- 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
textinput toint - Change the value of
textindata.jsonltonull - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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