Skip to content

Conversation

bjornasm
Copy link
Contributor

@bjornasm bjornasm commented Oct 22, 2024

The existing code to calculate the percentages shown in the html report str(summarized_phase.percentage * 100)[:6] will fail if the number is on the form of 8.09860748592347e-07 or similar. Changed to round(summarized_phase.percentage,4) to give a rounded number that is correct.

summarized_phase.percentage = 8.09860748592347e-07
str(summarized_phase.percentage*100)[:6]
>'8.0986'
round(summarized_phase.percentage*100,4)
>0.0001

str(summarized_phase.percentage * 100)[:6] will fail if the number is on the form of 1.23e-05 or similar. Changed to round.
@bjornasm bjornasm changed the title Changed bug in percentage calculation in query_graph Bug in percentage calculation in query_graph Oct 22, 2024
@Mytherin Mytherin merged commit baa915d into duckdb:main Oct 23, 2024
18 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

@bjornasm bjornasm deleted the percentage-bug branch October 23, 2024 07:37
github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Nov 2, 2024
fix: standardize usage of LogicalType::ROW_TYPE for COLUMN_IDENTIFIER_ROW_ID (duckdb/duckdb#14480)
Bug in percentage calculation in query_graph (duckdb/duckdb#14494)
bump vss (duckdb/duckdb#14493)
github-actions bot added a commit to duckdb/duckdb-r that referenced this pull request Nov 2, 2024
fix: standardize usage of LogicalType::ROW_TYPE for COLUMN_IDENTIFIER_ROW_ID (duckdb/duckdb#14480)
Bug in percentage calculation in query_graph (duckdb/duckdb#14494)
bump vss (duckdb/duckdb#14493)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
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.

2 participants