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(ingest/powerbi): support each expression in m-query function invocation #7541

Conversation

siddiquebagwan
Copy link
Contributor

@siddiquebagwan siddiquebagwan commented Mar 10, 2023

Quick fixes after PR: #7502

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Mar 10, 2023
Copy link
Collaborator

@hsheth2 hsheth2 left a comment

Choose a reason for hiding this comment

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

mostly looking good, just some code cleanliness things

@@ -100,6 +100,8 @@ combine_result

`Pattern-1` is supported as it first assign the table from schema to variable and then variable is used in M-Query Table function i.e. Table.Combine

Note: If you are using (PowerBI Parameters)[https://learn.microsoft.com/en-us/power-query/power-query-query-parameters]. then avoid using same name for variable in M-Query
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should also add the caveat that we don't support parameters with the admin API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it in Admin Ingestion vs. Basic Ingestion

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Reviewd this LGTM! waiting for final pass from @hsheth2

@@ -304,6 +305,7 @@ unary_expression: type_expression
| "+" unary_expression
| "_" unary_expression
| "not" unary_expression
| expression
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice - so this broadens the definition so that unary expression can be any type of expression?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yep - this isn't strictly correct because it can cause incorrect order of operations in the AST (e.g. addition before multiplication or something), but we don't really care about that here

@@ -432,17 +434,7 @@ optional_parameter: "optional" WS_INLINE parameter

each_expression: "each" WS_INLINE each_expression_body

// relational_expression rule is different then relational expression used in below grammar to resolve "each" construct
each_expression_body: function_body
Copy link
Collaborator

Choose a reason for hiding this comment

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

in simple terms - why are we able to remove this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

the addition to unary operator makes this one work correctly

# This is the case where they reference a variable using
# the `#"Name of variable"` syntax.
# the `#"Name of variable"` or `Variable` syntax. It can be
Copy link
Collaborator

Choose a reason for hiding this comment

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

What was the previous assert doing here? No purpose?

Copy link
Collaborator

Choose a reason for hiding this comment

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

this broadens it from quoted_identifier -> identifier (which includes regular_identifier)

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

@hsheth2 hsheth2 changed the title fix(ingestion): powerbi # support each expression in m-query function invocation fix(ingest/powerbi): support each expression in m-query function invocation Mar 15, 2023
@hsheth2 hsheth2 merged commit 0a36826 into datahub-project:master Mar 15, 2023
shirshanka pushed a commit to shirshanka/datahub that referenced this pull request Mar 22, 2023
…cation (datahub-project#7541)

Co-authored-by: MohdSiddiqueBagwan <mohdsiddique.bagwan@gslab.com>
Co-authored-by: Harshal Sheth <hsheth2@gmail.com>
shirshanka pushed a commit to shirshanka/datahub that referenced this pull request Mar 22, 2023
…cation (datahub-project#7541)

Co-authored-by: MohdSiddiqueBagwan <mohdsiddique.bagwan@gslab.com>
Co-authored-by: Harshal Sheth <hsheth2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants