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

Update the format of the comparison function output #71

Closed
tcezard opened this issue Dec 1, 2023 · 2 comments · Fixed by #73
Closed

Update the format of the comparison function output #71

tcezard opened this issue Dec 1, 2023 · 2 comments · Fixed by #73

Comments

@tcezard
Copy link
Member

tcezard commented Dec 1, 2023

In this issue we discussed changing the format of the comparison function to address future update. The main changes are:

  • rename "arrays" to "attributes"
  • rename "elements" to "array_elements"
  • Within array_elements, explode the total to get the count of level2 elements per attribute

Before

{
  "digests": {
    "a": "8djrpzjdbsoeghbadoadq.", 
    "b": "psuhfbsjwttzaywhdjsid"
  },
  "arrays": {
    "a_only": [],
    "b_only": [], 
    "a_and_b": ["names", "lengths", "sequences"],
  "elements": {
    "total":{
       "a":3,
       "b":3,
    },
    "a_and_b": {
       "names":2,
       "lengths":2,
       "sequences":2
    }
    "a_and_b_same_order": {
       "names":true,
       "lengths":true,
       "sequences":true
    }
  }
}

After

{
  "digests": {
    "a": "8djrpzjdbsoeghbadoadq.", 
    "b": "psuhfbsjwttzaywhdjsid"
  },
  "attributes": {
    "a_only": [],
    "b_only": [], 
    "a_and_b": ["names", "lengths", "sequences"],
  "array_elements": {
    "a":{
       "names":3,
       "lengths":3,
       "sequences":3
    },
    "b": {
       "names":3,
       "lengths":3,
       "sequences":3
    },
    "a_and_b": {
       "names":2,
       "lengths":2,
       "sequences":2
    },
    "a_and_b_same_order": {
       "names":true,
       "lengths":true,
       "sequences":true
    }
  }
}
@waterflow80
Copy link
Collaborator

@tcezard
For the array_elements (a and b), should we consider all the attributes that a (or b) has. i.e the attributes proper to a (or b) and the the common ones too.

For example, if a has a unique attribute called new_attribute, should we have the output below:

  "digests": {
    "a": "8djrpzjdbsoeghbadoadq.", 
    "b": "psuhfbsjwttzaywhdjsid"
  },
  "attributes": {
    "a_only": ["new_attribute"],
    "b_only": [], 
    "a_and_b": ["names", "lengths", "sequences"],
  "array_elements": {
    "a":{
       "names":3,
       "lengths":3,
       "sequences":3,
       "new_attribute": 3
    },
    "b": {
       "names":3,
       "lengths":3,
       "sequences":3
    },
    "a_and_b": {
       "names":2,
       "lengths":2,
       "sequences":2
    },
    "a_and_b_same_order": {
       "names":true,
       "lengths":true,
       "sequences":true
    }
  }
} 

@tcezard
Copy link
Member Author

tcezard commented Jan 6, 2024

Slight update to this in the associated issue in this comment. I've formalised the decision to ensure it stabilises in this ADR
At this point the only change is that attribute a, b, and ,a_and_b are replaced with a_count, b_count, and a_and_b_count

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 a pull request may close this issue.

2 participants