test: add escape for keys when serialize#202
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
=======================================
Coverage 75.17% 75.17%
=======================================
Files 35 35
Lines 2417 2417
=======================================
Hits 1817 1817
Misses 600 600 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses missing escaping of Polars DataFrame field names (keys) when serializing to InfluxDB line protocol, aligning Polars serialization behavior with line protocol requirements and closing the reported issue.
Changes:
- Escape field keys (column names) during Polars DataFrame serialization to line protocol.
- Add a regression test covering whitespace escaping in tag keys and field keys.
- Update the changelog with the new behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
influxdb_client_3/write_client/client/write/polars_dataframe_serializer.py |
Escapes field keys via escape_key() when building the fields portion of line protocol. |
tests/test_polars.py |
Adds a test asserting proper escaping for whitespace in tag keys and field keys. |
CHANGELOG.md |
Documents the change in upcoming release notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
influxdb_client_3/write_client/client/write/polars_dataframe_serializer.py
Show resolved
Hide resolved
alespour
left a comment
There was a problem hiding this comment.
LGTM. Copilot suggests more precise wording in CHANGELOG, but I think it is nitpicking.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes Issue
Proposed Changes
Checklist