Skip to content

Conversation

@Ahalya-ni
Copy link
Collaborator

@Ahalya-ni Ahalya-ni commented Jan 5, 2026

🤨 Rationale

This PR introduces Data Table ID and Data Table Name as selectable metadata fields in the column dropdown, allowing users to explicitly choose when to include these properties in their panel output.

Previous Behavior: Data Table ID and Name were automatically included in all results alongside selected columns, requiring users to add manual transformations in existing dashboards to exclude these fields when not needed.

New Behavior: Users can now selectively include Data Table ID and/or Name only when required, eliminating the need for exclude column transformations in existing dashboards.

👩‍💻 Implementation

  • Created field identifiers with -Metadata suffix to distinguish them from regular columns in types.ts and follow the pattern as same as other column.
  • Modified getColumnOptionsWithVariables() to include data table ID and name field options.
  • Modified column limit validation to only count non-metadata columns.
  • Updated aggregateTableDataRows() to
    conditionally adds Data Table ID and/or Name fields to results based on user selection

selection_dfs_id_name

🧪 Testing

Added unit tests to verify the newly introduced functionality and updated the affected test cases.

✅ Checklist

Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces Data Table ID and Data Table Name as selectable metadata fields in the column dropdown, changing them from being automatically included in all query results to opt-in selections. This allows users to control when these fields appear in their panel output, eliminating the need for exclude column transformations in existing dashboards.

Key Changes:

  • Added metadata field identifiers (with -Metadata suffix) to distinguish them from regular columns
  • Modified column selection validation to exclude metadata fields from the 20-column limit
  • Updated query logic to conditionally include metadata fields in results based on user selection

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/datasources/data-frame/types.ts Defined constants for metadata field identifiers and labels using -Metadata suffix pattern
src/datasources/data-frame/datasources/v2/DataFrameDataSourceV2.ts Implemented core logic: prepended metadata options to column dropdown, filtered metadata from column limit checks, conditionally queried table names, and conditionally included metadata in output fields
src/datasources/data-frame/datasources/v2/DataFrameDataSourceV2.test.ts Added comprehensive test coverage for metadata field selection scenarios including edge cases (only metadata fields selected, combined with regular columns, multiple tables)
src/datasources/data-frame/components/v2/DataFrameQueryEditorV2.tsx Adjusted column options limit calculation to accommodate metadata field options
src/datasources/data-frame/components/v2/DataFrameQueryEditorV2.test.tsx Updated test expectations to account for metadata fields in dropdown options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kartheeswaran-ni kartheeswaran-ni merged commit a794833 into main Jan 6, 2026
8 checks passed
@kartheeswaran-ni kartheeswaran-ni deleted the users/ahalya/feat/dataframe/make-id-and-name-as-selection branch January 6, 2026 17:09
Ahalya-ni pushed a commit that referenced this pull request Jan 21, 2026
## [4.112.0](v4.111.3...v4.112.0) (2026-01-06)

### Features

* **dataframe:** Add data table ID and name as selection from column dropdown ([#639](#639)) ([a794833](a794833))
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.

3 participants