Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix todataframe() to do not iterate the table multiple times #581

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

dnicolodi
Copy link
Contributor

@dnicolodi dnicolodi commented Jan 19, 2022

Converting the table data to a list simply with list() causes the
table to be materialized three times because list() calls len()
on the table twice to populate the list.

Anyhow, there is no need to have the table data in a list when an
iteratotor can be passed to pandas.DataFrame.from_records().

Fixes #578.

Converting the table data to a list simply with list() causes the
table to be materialized three times because list() calls __len__()
on the table twice to populate the list.

Anyhow, there is no need to have the table data in a list when an
iteratotor can be passed to pandas.DataFrame.from_records().

Fixes petl-developers#578.
@coveralls
Copy link

coveralls commented Jan 19, 2022

Coverage Status

Coverage remained the same at 91.12% when pulling cbae170 on dnicolodi:todataframe-fix into 33f7328 on petl-developers:master.

@juarezr juarezr merged commit c29120e into petl-developers:master Jan 26, 2022
@juarezr juarezr added the Bug It must work in all situations, but this failed label Jan 26, 2022
@juarezr juarezr added Performance and removed Bug It must work in all situations, but this failed labels Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

petl todataframe() multiply run lambda function in addfield
3 participants