Skip to content

feat: Export Specs as Dataframe#98

Merged
RSam-NI merged 82 commits intoni:masterfrom
Shri2109:users/sam-rishi/feat-spec-dataframe-utility
Mar 13, 2025
Merged

feat: Export Specs as Dataframe#98
RSam-NI merged 82 commits intoni:masterfrom
Shri2109:users/sam-rishi/feat-spec-dataframe-utility

Conversation

@sam-rishi
Copy link
Contributor

@sam-rishi sam-rishi commented Mar 4, 2025

What does this Pull Request accomplish?

  • Adds utility for exporting specs as a dataframe.
  • User can pass column projection and a function for condition formatting in the parameters.
  • If column projection is not passed, all the columns will be included in the dataframe as a default approach.
  • If condition formatting is not passed, default condition formatting will be done. In the default condition formatting, the column headers will be in condition_conditionName(conditionUnit) format if the condition value is NumericConditionValue and condition_conditionName format if the condition value is StringConditionValue. The column value will be in [min: num; max; step], num, num format where data within [] is condition range and other num values are discrete values if the condition value is NumericConditionValue and str, str, str where the str values are discrete values if the condition value is StringConditionValue.
  • If column projection is passed and either CONDITION_NAME or CONDITION_VALUES is not included, the condition formatting won't be done and conditions columns will be excluded in the dataframe.

Why should this Pull Request be merged?

  • This utility can be used to export specs as a dataframe with only the specified columns and specified condition format.
  • The user can easily retrieve only the necessary data in their desired format.

What testing has been done?

  • Automated integration tests are included.

Sam rishi and others added 30 commits February 21, 2025 18:40
…model

Response Model for Query Specs with Only Optional Fields
@ni ni deleted a comment from sam-rishi Mar 7, 2025
@sam-rishi sam-rishi requested a review from SSSantosh18 March 7, 2025 16:49
@SSSantosh18 SSSantosh18 requested a review from rbell517 March 7, 2025 16:57
@SSSantosh18 SSSantosh18 requested a review from rbell517 March 10, 2025 16:24
}


def convert_specs_to_dataframe(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We didn't discuss it in the meeting this morning, but what you do with the conditions mapping function would impact what you'd want the index to be. Its also not clear to me with this parameter if that would mean you're creating a MultiIndex index or a new column that is the serialized combination of these columns. I would expect a MultiIndex would be more useful. Either way doing this would impact your data access in ways that probably would not help usability. Workspace and product IDs are not very commonly known, compared with the their name and part number equivalents.

I'm inclined to leave this unindexed or indexed by id if it is available in the projection (not specId) and let the caller reindex in whatever way makes sense for them.

@SSSantosh18 SSSantosh18 requested a review from rbell517 March 11, 2025 15:04
@santhoshramaraj santhoshramaraj added the enhancement New feature or request label Mar 11, 2025
@RSam-NI RSam-NI merged commit ae1b608 into ni:master Mar 13, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants