influxdata / influxdata/influxdb-client-php
Omission of a required Field should trigger an exception rather than failing silently
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 166
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
Proposal:
Introduce a distinct exception for attempts to write a Point without a field. This would facilitate debugging, accelerate the learning curve for InfluxDB's key concepts, and provide a transparent error message.
Current behavior:
Writing a Point without a field currently results in silent failure, with the Point being transformed to null and no indication that the Point has been disregarded.
Desired behavior:
Trigger an exception when a developer attempts to write a Point with no field.
Alternatives considered:
Display a clear warning to indicate that the Point is being ignored due to the absence of a field.
Use case:
InfluxDB mandates that each Point must contain at least one field. This requirement might not be intuitive for newcomers. Thus, generating an exception for such cases would significantly reduce time and frustration when initially working with the database.
In my experience, I had to debug the client's code to understand why my Point wasn't being written. Although it's essential to have at least one field, this wasn't immediately clear to me, leading to unnecessary confusion.
Contributor guide
No contributing guide indexed for this repository
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 file or test is named in the issue. Start by locating the Point write and serialization path in the PHP client, then inspect how invalid Points and existing exceptions are tested. Done means attempting to write a Point without any field raises a distinct exception instead of silently discarding it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100