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: fixed condition parsing and display #37

Merged
merged 1 commit into from May 15, 2024

Conversation

ShubhranshuSanjeev
Copy link
Collaborator

Problem

We had inconsistent parsing logic for context, which led to wrong data display of context.

Solution

Fix the parsing logic

@ShubhranshuSanjeev ShubhranshuSanjeev requested a review from a team as a code owner May 7, 2024 14:25
@mahatoankitkumar
Copy link
Collaborator

Would be helpful if you could add before after screenshots.

@ShubhranshuSanjeev
Copy link
Collaborator Author

Would be helpful if you could add before after screenshots.

No UI changes

@ShubhranshuSanjeev ShubhranshuSanjeev force-pushed the fix/condition-parsing branch 2 times, most recently from 0b57a01 to 519da2c Compare May 9, 2024 09:16
let dimension_name = operands
.iter()
.find_map(|item| match item.as_object() {
Some(o) if o.contains_key("var") => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we have better name instead of "o"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hey, o is just a throw away variable not even being used anywhere instead of that Some() arm, if its affecting readability I will change, if not lets go with this.
In my opinion I don't really think we need a full word for variable name for these kind of scenarios.

Copy link
Collaborator

Choose a reason for hiding this comment

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

you are using o in o.contains_key and in o["var"], when you are operating on any variable it would be better if it is not just o,a,b,c,d single alphabet,
atleast val would work

@ShubhranshuSanjeev ShubhranshuSanjeev self-assigned this May 13, 2024
@ShubhranshuSanjeev ShubhranshuSanjeev marked this pull request as draft May 15, 2024 08:13
Other(String),
}

impl Display for ConditionOperator {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use strum here ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There was no way in strum to serialize this Other(String) into to just use the inner value, so went ahead with this approach.

@ShubhranshuSanjeev ShubhranshuSanjeev marked this pull request as ready for review May 15, 2024 10:26
@ShubhranshuSanjeev ShubhranshuSanjeev merged commit 023bc6b into main May 15, 2024
4 checks passed
@ShubhranshuSanjeev ShubhranshuSanjeev deleted the fix/condition-parsing branch May 15, 2024 13:41
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.

None yet

5 participants