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

pkg/query: Fix cases where dicts are empty #3580

Merged
merged 1 commit into from
Aug 8, 2023
Merged

Conversation

brancz
Copy link
Member

@brancz brancz commented Aug 8, 2023

No description provided.

@alwaysmeticulous
Copy link

alwaysmeticulous bot commented Aug 8, 2023

🤖 Meticulous replayed 50 user sessions and took 214 screenshots. Meticulous has not yet run on cc5988a of the main branch and so there was nothing to compare against.

If you recently setup Meticulous, this is expected. Meticulous will start reporting comparisons for new pull requests after the next commit to the main branch.

Last updated for commit 50e50c3. This comment will update as new commits are pushed.

if lineRow >= 0 && r.LineFunction.IsValid(lineRow) && len(r.LineFunctionNameDict.Value(r.LineFunctionName.GetValueIndex(lineRow))) > 0 {
_ = fb.builderFunctionName.Append(r.LineFunctionNameDict.Value(r.LineFunctionName.GetValueIndex(lineRow)))
} else {
if r.LineFunctionNameDict.Len() == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think you can collapse both AppendNull branches by adding the inverse of this Len check to lineRow >= 0

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I agree this needs some refactoring, but this is gonna change with unifying dictionaries anyway so I kept it consistent with the rest of the codebase.

fb.builderFunctionSystemName.AppendNull()
} else {
if lineRow >= 0 && r.LineFunction.IsValid(lineRow) && len(r.LineFunctionSystemNameDict.Value(r.LineFunctionSystemName.GetValueIndex(lineRow))) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like the case implementation could be a helper function used by the branches. Maybe for a later refactoring.

@brancz brancz merged commit 1694b2b into main Aug 8, 2023
35 checks passed
@brancz brancz deleted the function-dict-empty branch August 8, 2023 11:19
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

2 participants