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] pivot: finer grained cycle detection #5026

Closed
wants to merge 1 commit into from

Conversation

LucasLefevre
Copy link
Collaborator

Description:

Steps to reproduce:

  • insert a fixed pivot (not dynamic!)
  • insert a new calculated measure
  • in the calculated measure formula, reference one of a cell which contains a header formula

=> the cell becomes a #CYCLE even though there's no circular dependendy
between the calculated measure and the other dimension header

Task: 4214188

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

Steps to reproduce:

- insert a fixed pivot (not dynamic!)
- insert a new calculated measure
- in the calculated measure formula, reference one of a cell which contains a
  header formula

=> the cell becomes a #CYCLE even though there's no circular dependendy
   between the calculated measure and the other dimension header

Task: 4214188
@robodoo
Copy link
Collaborator

robodoo commented Sep 27, 2024

Pull request status dashboard

Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pouet pouet 🎺

@@ -37,7 +37,8 @@ export function assertDomainLength(domain: Maybe<FunctionResultObject>[]) {

export function addPivotDependencies(
evalContext: EvalContext,
coreDefinition: PivotCoreDefinition
coreDefinition: PivotCoreDefinition,
forMeasures: PivotCoreMeasure[]
) {
//TODO This function can be very costly when used with PIVOT.VALUE and PIVOT.HEADER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated: what's the state of this TODO ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think it's still a todo until we find it to be a real bottleneck ;-)

@@ -813,7 +817,7 @@ export const PIVOT = {
const pivotId = getPivotId(_pivotFormulaId, this.getters);
const pivot = this.getters.getPivot(pivotId);
const coreDefinition = this.getters.getPivotCoreDefinition(pivotId);
addPivotDependencies(this, coreDefinition);
addPivotDependencies(this, coreDefinition, coreDefinition.measures);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So now we can reference headers of PIVOT.HEADER() but not headers originating from a spread pivot formula if I understand the code correctly. Do you think there's any way we can make that work ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think there's any way we can make that work ?

yes, but it'd be quite difficult I think. Every cell would need to be computed in the correct dependency order, when they are needed.

@rrahir
Copy link
Collaborator

rrahir commented Oct 11, 2024

@robodoo r+

@robodoo robodoo closed this in 77c19d8 Oct 11, 2024
@fw-bot fw-bot deleted the 18.0-finer-grained-pivot-cycle-lul branch October 25, 2024 08:17
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.

4 participants