influxdata / influxdata/influxdb
Automatic Int to Float conversion
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Proposal:
Allow integers to automatically cast to floats if a field is already id'd as a float field
Current behavior:
Currently, when you try to insert an int to a float field, the record gets rejected.
Desired behavior:
It would be great to have the int cast as a float for record insertion. This way you are less likely to reject records that are otherwise fine.
Alternatives considered:
Alternatively, one could just cast everything to a float themselves, which is fair enough, but a lot of programming languages are okay with the widening of ints, so it seems strange that influxdb isn't.
Use case:
Why is this important (helps with prioritizing requests)? QOL change and standardization
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
No files, tests, or entry points are named. Start by tracing InfluxDB's field-type validation and record-insertion path, then identify how existing float fields reject integer values. Done means integer writes are accepted for established float fields and coverage verifies the intended widening behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100