Skip to content

fix(write): match DataFrame timestamp column by exact name - #734

Open
arieleven wants to merge 4 commits into
influxdata:masterfrom
arieleven:fix/dataframe-timestamp-column-match
Open

arieleven wants to merge 4 commits into
influxdata:masterfrom
arieleven:fix/dataframe-timestamp-column-match

Conversation

@arieleven

Copy link
Copy Markdown

Requested by Taltal · project thread

Closes #592

Proposed Changes

DataframeSerializer decided whether a column is the timestamp column with key in timestamp_column, a substring check on the column name. Any field whose name is part of the timestamp column name was treated as the timestamp and dropped: with data_frame_timestamp_column="OpenTime", the Open column from #592 never reaches InfluxDB. If every field matches that way, serialization raises IndexError.

This compares the names with == and adds a regression test with OpenTime, Open and Time columns. The test fails on master with IndexError and passes with the change.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • pytest tests completes successfully (offline suites: same results with and without this change; the tests that need a running InfluxDB were not run against a server)
  • Commit messages are conventional
  • Sign CLA (if not already signed)

The serializer tested 'key in timestamp_column', a substring check, so a
field column whose name is part of the timestamp column name (Open with
OpenTime) was treated as the timestamp and silently dropped. When every
field matched that way the serializer raised IndexError.

Closes influxdata#592
@codecov-commenter

codecov-commenter commented Nov 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.54%. Comparing base (1865aca) to head (3932ddf).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #734      +/-   ##
==========================================
+ Coverage   90.43%   90.54%   +0.10%     
==========================================
  Files          41       41              
  Lines        3577     3585       +8     
==========================================
+ Hits         3235     3246      +11     
+ Misses        342      339       -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.

@bednar
bednar requested a review from karel-rehor November 4, 2026 14:51
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.

Column Open of a Pandas DataFrame is lost

3 participants