Skip to content

[FIX] pandas_compat: fix table_from_frames for "normal" dataframe#5652

Merged
VesnaT merged 3 commits intobiolab:masterfrom
PrimozGodec:fix-pandas_compat2
Nov 14, 2021
Merged

[FIX] pandas_compat: fix table_from_frames for "normal" dataframe#5652
VesnaT merged 3 commits intobiolab:masterfrom
PrimozGodec:fix-pandas_compat2

Conversation

@PrimozGodec
Copy link
Copy Markdown
Contributor

@PrimozGodec PrimozGodec commented Oct 18, 2021

Issue

table_from_frames errored when it recieved a dataframe which is not OrangeDataFrame. Look at new test for an example.
fixes #5622

Description of changes

This PR solves two errors:

  • do not expect df.orange_attributes for data frame that is not OrangeDataFrame
  • make vars_from_df use take into account role parameter for data frame which is not OrangeDataFrame
  • make sure indexes of all three data frames are equal and if index is not range index it should be placed in metas
Includes
  • Code changes
  • Tests
  • Documentation

@PrimozGodec
Copy link
Copy Markdown
Contributor Author

This PR cannot be merged before #5620

@PrimozGodec PrimozGodec marked this pull request as draft October 19, 2021 12:06
@PrimozGodec PrimozGodec marked this pull request as ready for review October 25, 2021 13:34
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 25, 2021

Codecov Report

Merging #5652 (fd9d708) into master (3634e37) will decrease coverage by 0.03%.
The diff coverage is 97.77%.

❗ Current head fd9d708 differs from pull request most recent head 9afaa96. Consider uploading reports for the commit 9afaa96 to get more accurate results

@@            Coverage Diff             @@
##           master    #5652      +/-   ##
==========================================
- Coverage   86.07%   86.04%   -0.04%     
==========================================
  Files         315      315              
  Lines       66048    65930     -118     
==========================================
- Hits        56854    56731     -123     
- Misses       9194     9199       +5     

@VesnaT VesnaT merged commit 542435d into biolab:master Nov 14, 2021
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.

Orange.data.Table.from_pandas_dfs() causes AttributeError: 'DataFrame' object has no attribute 'orange_attributes'

2 participants