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

Refactor getMacroMatches & fix a couple of bugs #863

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

njvrzm
Copy link
Contributor

@njvrzm njvrzm commented Jan 18, 2024

What this PR does / why we need it:

This refactors and updates getMacroMatches and parseArgs to remove duplicated logic and address two bugs.

Refactoring: previously getMacroMatches and parseArgs did quite a bit of overlapping work: getMacroMatches would parse the input string to find a bracketed substring string representing macro arguments, then parseArgs would take that string and parse it again to extract the arguments. The logic was also implemented differently in each. I've moved all the work of parsing arguments into parseArgs.

Bugs addressed:

Which issue(s) this PR fixes:

Fixes #859, #861.

Special notes for your reviewer:

Once the base branch (858-changes_from_sqlds) is merged I'll retarget this to main.

@njvrzm njvrzm self-assigned this Jan 18, 2024
@njvrzm njvrzm force-pushed the macros_refactoring_and_fixes branch from 830672f to 6e778df Compare January 18, 2024 11:16
@njvrzm njvrzm marked this pull request as ready for review January 18, 2024 11:24
@njvrzm njvrzm requested a review from a team as a code owner January 18, 2024 11:24
@njvrzm njvrzm requested review from gabor, yesoreyeram and gwdawson and removed request for a team January 18, 2024 11:24
Copy link
Contributor

@gabor gabor left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Base automatically changed from 858-changes_from_sqlds to main January 22, 2024 13:31
@njvrzm njvrzm requested a review from a team as a code owner January 22, 2024 13:31
@njvrzm njvrzm requested review from wbrowne, andresmgot and oshirohugo and removed request for a team January 22, 2024 13:31
This addresses #859
and #861 and
removes some duplicated logic.
@njvrzm njvrzm force-pushed the macros_refactoring_and_fixes branch from 6e778df to a8060fc Compare January 22, 2024 13:35
@njvrzm njvrzm merged commit e1ea456 into main Jan 22, 2024
3 checks passed
@njvrzm njvrzm deleted the macros_refactoring_and_fixes branch January 22, 2024 13:38
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.

Macros can consume too much of a query containing parentheses
2 participants