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

Set Branch pruning Off by default #1148

Closed
wants to merge 13 commits into from

Conversation

rolandsusans
Copy link
Contributor

@rolandsusans rolandsusans commented Aug 28, 2019

This is:

  • a bugfix

#1149

Checklist:

Why this change is needed?

@rolandsusans rolandsusans changed the title Branch pruning demo Set Branch pruning Off by default Aug 28, 2019
@frantzmiccoli
Copy link
Contributor

I think we could do better than disabling by default by fixing the bug you may have discovered.

The branch pruning is not supposed to have side effects, but as you noticed I was not sure of this.

You add a test with a dependency on an Excel file that contains thousands of lines, could you consider updating CalculationTest.php with an minimal reproducible example that shows your point ? You have an example of how created a spreadsheet without an object on line 122 /~https://github.com/PHPOffice/PhpSpreadsheet/blob/master/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php#L122

If that's ok, once you are done I will investigate on that.

@rolandsusans
Copy link
Contributor Author

@frantzmiccoli I have simplified the excel file. ( reduced amount of rows, left only one worksheet )
1 test is meant to be failing - it highlights the case where branch pruning is braking the calculation.

@rolandsusans
Copy link
Contributor Author

Hope it helps you to find the bug in-branch pruning.

@rolandsusans
Copy link
Contributor Author

@frantzmiccoli have you made any progress on this investigation ?

@frantzmiccoli
Copy link
Contributor

@rolandsusans No, I will try to spend time on it this week-end.

@frantzmiccoli
Copy link
Contributor

Sorry I have been lacking time to work on that, I put it in my agenda for next sunday.

@PowerKiKi
Copy link
Member

@frantzmiccoli thank you for investigating this one. I took the liberty to assign you the issue...

@frantzmiccoli
Copy link
Contributor

This is not a bug related with the branch pruning but with IF formula resolution.

$spreadsheet = new Spreadsheet();
$workSheet = $spreadsheet->getActiveSheet();

$cellA1 = $workSheet->getCell('A1');
$cellA1->setValue('=IF(NA(),1,0)');
$this->assertEquals('#N/A', $cellA1->getCalculatedValue());
// instead of '#N/A' we get 1 here.

In the sample file, instead of 1, the resolved value is '#N/A'. I am working on a fix.

@frantzmiccoli
Copy link
Contributor

See #1165

This fix is not enough to fix inconsistencies though.

@frantzmiccoli
Copy link
Contributor

#1167 fixes the remaining problem.

@rolandsusans
Copy link
Contributor Author

@frantzmiccoli Tnx for investigation. I checked those PR's and left some comments. Will close this PR.

@rolandsusans rolandsusans deleted the branch-pruning-demo branch September 23, 2019 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants