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

Revert "Move _path_key_to_spec to ElementPathKey." #1177

Merged
merged 1 commit into from
May 6, 2024

Conversation

tlento
Copy link
Contributor

@tlento tlento commented May 3, 2024

This reverts commit bcbf1bf.

The original layout of linkable_element, with the private helper
converting ElementPathKey to the relevant LinkableInstanceSpec,
was intentionally placed to avoid circular dependencies with
the WhereFilterSpec during predicate pushdown implementation.

The code configuration from the reverted commit is nicer in many
respects, but unfortunately an attempt to use it ran into
circular dependencies as expected, and the TYPE_CHECKING work-around
ultimately failed because of the way SerializableDataclass works.
Specifically, SerializableDataclass needs the class to create a concrete
object during its operation, so runtime access to the object is required
it's part of a SerializableDataclass hierarchy.

Since the SerializableDataclass mechanism is fully in use in the
implementation of some dbt cloud extensions we cannot easily
evalaute updates to that model here, and it is therefore much
simpler to just revert this change and move forward.

Copy link

github-actions bot commented May 3, 2024

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

github-actions bot commented May 3, 2024

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 non-optional-linkable-set branch from c40e6b1 to 7c580e1 Compare May 6, 2024 17:29
@tlento tlento force-pushed the revert-spec-dependency-on-element-path-key branch from 3ae634f to 4bbc8e0 Compare May 6, 2024 17:29
@plypaul
Copy link
Contributor

plypaul commented May 6, 2024

👍

For context on the issue with SerializableDataclass - For deserialization, we need the classes at runtime because you need the class to create a concrete object. So doing if typing.TYPE_CHECKING won't work in those cases.

@tlento tlento force-pushed the revert-spec-dependency-on-element-path-key branch from 4bbc8e0 to 97fc59c Compare May 6, 2024 22:46
Base automatically changed from non-optional-linkable-set to main May 6, 2024 22:51
This reverts commit bcbf1bf.

The original layout of linkable_element, with the private helper
converting ElementPathKey to the relevant LinkableInstanceSpec,
was intentionally placed to avoid circular dependencies with
the WhereFilterSpec during predicate pushdown implementation.

The code configuration from the reverted commit is nicer in many
respects, but unfortunately an attempt to use it ran into
circular dependencies as expected, and the TYPE_CHECKING work-around
ultimately failed because of the way SerializableDataclass works.

Since the SerializableDataclass mechanism is fully in use in the
implementation of some dbt cloud extensions we cannot easily
evalaute updates to that model here, and it is therefore much
simpler to just revert this change and move forward.
@tlento tlento force-pushed the revert-spec-dependency-on-element-path-key branch from 97fc59c to 41dc93b Compare May 6, 2024 22:54
@tlento tlento enabled auto-merge (squash) May 6, 2024 22:55
@tlento tlento disabled auto-merge May 6, 2024 22:56
@tlento tlento enabled auto-merge (squash) May 6, 2024 22:56
@tlento tlento disabled auto-merge May 6, 2024 22:56
@tlento tlento enabled auto-merge (squash) May 6, 2024 22:57
@tlento
Copy link
Contributor Author

tlento commented May 6, 2024

For context on the issue with SerializableDataclass - For deserialization, we need the classes at runtime because you need the class to create a concrete object. So doing if typing.TYPE_CHECKING won't work in those cases.

Yup, that is what I was seeing! I updated the PR description to include this information.

@tlento tlento merged commit 426bf30 into main May 6, 2024
24 checks passed
@tlento tlento deleted the revert-spec-dependency-on-element-path-key branch May 6, 2024 22:58
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.

3 participants