feat(data frame): Add generic type support via render return value #1502
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.
Add support for
@render.data_frame
to know what the real type should be for.data_value()
,.data()
, and any other data related methods.Ex: Both
first_df
andsecond_df
are aware that the return value of the render method has an underlying data type of [pandas.]DataFrame
. This also works forpolars.DataFrame
.TODO:
PandasCompatible
type. The__new__
ofDataGrid
andDataTable
does not convey that it is converted to apandas.DataFrame
.Solution ✅ : Users call

df.to_pandas()
to convert their data to pandasBad workaround: Give type to

@render.data_frame[PdDataFrame]