Skip to content

fix: report unsupported backslashes in field keys - #737

Open
2836048681 wants to merge 4 commits into
influxdata:masterfrom
2836048681:fix/660-field-key-backslash-space
Open

2836048681 wants to merge 4 commits into
influxdata:masterfrom
2836048681:fix/660-field-key-backslash-space

Conversation

@2836048681

Copy link
Copy Markdown

Closes #660.

Proposed changes

When a field key contains an odd number of backslashes immediately before a space, escaping the space adds one more backslash. InfluxDB consumes the resulting backslashes in pairs and reads the space as a delimiter. A write then fails with HTTP 400 and an invalid field format error.

Raise a ValueError from Point.to_line_protocol() that names the field key and explains the unsupported sequence. Point and dictionary writes get the same validation through the serializer. The check runs only for fields that will be included in the output.

Validation

  • All 49 point tests and seven subtests passed. The four new rejection subtests failed on the original code.
  • On local InfluxDB 2.7.6, the original payload returned HTTP 400. The patched synchronous writer raised ValueError before issuing a request, and valid field keys round-tripped with their names intact.
  • Flake8 passed for the changed module. The full lint command reported two E721 violations in generated API clients, both reproduced on the original code. Git diff checks passed.
  • Full suite on Python 3.12 against local InfluxDB 2.7.6 reported 420 passed, 3 skipped, including 15 passing subtests. The test log is screening/pytest-fixed-full-workspace.log in the round workspace.

Checklist

  • CHANGELOG.md updated
  • Regression tests added
  • Conventional commit message
  • Full test suite passes
  • CLA signed by submitter, if required

@bednar
bednar requested a review from karel-rehor November 26, 2026 08:26
@karel-rehor
karel-rehor force-pushed the fix/660-field-key-backslash-space branch from 2bfa65d to 038f438 Compare December 1, 2026 13:44
@codecov-commenter

codecov-commenter commented Dec 2, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.78%. Comparing base (354d881) to head (2eab2c8).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #737      +/-   ##
==========================================
- Coverage   90.83%   90.78%   -0.06%     
==========================================
  Files          41       41              
  Lines        3591     3601      +10     
==========================================
+ Hits         3262     3269       +7     
- Misses        329      332       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@karel-rehor karel-rehor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@2836048681 (MingYang Lu)

Thank you for this contribution. I see from the git log that this is committed directly from Codex.

commit 038f4388bcd85e8ebb194600f480fe779629a401 (HEAD -> fix/660-field-key-backslash-space, origin/fix/660-field-key-backslash-space)
Author: Codex <codex@local.invalid>
Date:   Sat Nov 21 08:15:47 2026 +0000

    fix: report unsupported backslashes in field keys

While it appears that the changes will fix issue #660 I don't think this PR meets Influx's criteria for contributing AI generated code. Since all contributors are responsible for the code they commit, the actually commit must be attributed to the contributor as the Author and not to the AI engine that generated the code.

If the commit can be reverted and reapplied under the git user's account, perhaps with some minor changes, then we can move this PR forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception from backslash followed by space in field key

3 participants