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

Add semantic_model_origin property to LinkableElement interface #1230

Merged

Conversation

tlento
Copy link
Contributor

@tlento tlento commented May 23, 2024

LinkableElements have a commonality, which is that they always have
either a semantic model where they are defined, or they are virtual
constructs (either metric queries or virtual dimensions, such as
metric_time).

In order to do predicate pushdown evaluation against source nodes,
we require the linkable element to have a singular semantic model origin.
That may be a virtual model, as in the case of metric_time or metric
elements, or it may be a concrete model, as in the case of all other
entities and dimensions.

This change provides that accessor. It is separated out for ease of
review due to the need to rename the existing semantic_model_origin
property. We could not re-use it, as dataclasses do not allow a mixture
of @Property decorated functions and simple properties. This has the
added benefit of differentiating between the semantic model origin,
which may be virtual, and the semantic model containing the element
definition.

Copy link
Contributor Author

tlento commented May 23, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @tlento and the rest of your teammates on Graphite Graphite

Copy link

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

1 similar comment
Copy link

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@tlento tlento force-pushed the add-element-type-to-linkable-element-interface branch from ee88ff9 to 2ec263f Compare May 24, 2024 01:03
Base automatically changed from add-element-type-to-linkable-element-interface to main May 24, 2024 01:09
Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

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

Makes sense!

LinkableElements have a commonality, which is that they always have
either a semantic model where they are defined, or they are virtual
constructs (either metric queries or virtual dimensions, such as
metric_time).

In order to do predicate pushdown evaluation against source nodes,
we require the linkable element to have a singular semantic model origin.
That may be a virtual model, as in the case of metric_time or metric
elements, or it may be a concrete model, as in the case of all other
entities and dimensions.

This change provides that accessor. It is separated out for ease of
review due to the need to rename the existing `semantic_model_origin`
property. We could not re-use it, as dataclasses do not allow a mixture
of @Property decorated functions and simple properties. This has the
added benefit of differentiating between the semantic model origin,
which may be virtual, and the semantic model containing the element
definition.
Copy link
Contributor Author

tlento commented Jun 25, 2024

Merge activity

  • Jun 24, 8:29 PM PDT: @tlento started a stack merge that includes this pull request via Graphite.
  • Jun 24, 8:30 PM PDT: @tlento merged this pull request with Graphite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants