Skip to content

Fix validation for DataFrame with only time column in dataframe_to_tsfile - #736

Merged
jt2594838 merged 7 commits into
apache:developfrom
hongzhi-gao:fix/py-time-col-check
Mar 4, 2026
Merged

jt2594838 merged 7 commits into
apache:developfrom
hongzhi-gao:fix/py-time-col-check

Conversation

@hongzhi-gao

Copy link
Copy Markdown
Contributor

Fix validation for DataFrame with only time column in dataframe_to_tsfile

Problem: The check len(column_schemas) == 0 never triggers when the DataFrame has only a time column, because in that case column_schemas still contains one element (the time column). The intended guard was to reject "no data columns besides time."

Change: Require at least one data column (FIELD or TAG) by filtering out TIME columns and checking that the remaining list is non-empty before building the table schema.

Tests: Existing test_dataframe_to_tsfile_no_data_columns now correctly raises ValueError; added test_dataframe_to_tsfile_only_time_column_raises to explicitly cover the only-time-column case.

@jt2594838
jt2594838 merged commit 27b1051 into apache:develop Mar 4, 2026
16 checks passed
@jt2594838
jt2594838 deleted the fix/py-time-col-check branch March 4, 2026 10:49
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.

2 participants