Repository navigation
Conversation
When the row list is empty and `dtypes` contains entries, the constructor creates a named empty series for each declared dtype using the corresponding series backend, then builds the dataframe from those series. A regression test checks column order, dtypes, and shape for eager and lazy dataframes. It also covers empty input without a schema and rejection of an invalid dtype. Fixes elixir-explorer#1137
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Creating a dataframe from an empty row list drops every column declared in
dtypes. Callers get a dataframe with zero rows and zero columns even when they supplied a schema.The constructor passed the empty list through the general input path. With no rows to supply column names, that path had no columns to apply the declared dtypes to.
What changed
When the row list is empty and
dtypescontains entries, the constructor creates a named empty series for each declared dtype using the corresponding series backend, then builds the dataframe from those series. A regression test checks column order, dtypes, and shape for eager and lazy dataframes. It also covers empty input without a schema and rejection of an invalid dtype.Testing
repo_lintran three times with no output or exit status shown.mix format --check-formattedran with no output or exit status shown.cargo fmt --manifest-path=${{ matrix.manifest }} --all -- --checkwas listed with no output or exit status shown.cargo clippy --manifest-path=${{ matrix.manifest }} -- -Dwarningswas listed with no output or exit status shown. A run with the explorer change reverted gave no clear result, so no test is shown to catch this bug. The changed test test/explorer/data_frame_test.exs did not run here: no test runner for it was available.Closes #1137