feat: make DataSet initialization similar to pandas' #4864
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant enhancements to the
DataSet
class in thelangflow
schema, including new methods for initialization and row addition, as well as comprehensive testing for these features. Below are the most important changes:Enhancements to
DataSet
class:Initialization Enhancements:
Data
objects, dictionaries, dictionary of lists, and pandas DataFrames.__init__
method to handle these different formats and ensure proper data conversion.Row Addition Methods:
add_row
method to allow adding a single row to the dataset, supporting bothData
objects and dictionaries.add_rows
method to allow adding multiple rows to the dataset, supporting lists ofData
objects or dictionaries.Testing Enhancements:
add_row
andadd_rows
methods to ensure correct behavior when adding rows with both dictionaries andData
objects.Import and Export Enhancements:
Module Import Adjustments:
__init__.py
to includeDataSet
in the module exports, ensuring it is accessible when the module is imported.Type Casting:
cast
fromtyping
to facilitate type casting within theDataSet
class methods.