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

Fixes dangling nodes in subdag with extract_* #156

Merged
merged 2 commits into from
Apr 28, 2023

Conversation

elijahbenizzy
Copy link
Collaborator

@elijahbenizzy elijahbenizzy commented Apr 27, 2023

[Short description explaining the high-level reason for the pull request]

Meh using tags to talk between decorators feels ugly. OTOH, I'm not sure there's a better way, and its pretty clear what's happening...

Changes

How I tested this

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@elijahbenizzy elijahbenizzy force-pushed the subdag-dangling-nodes branch 2 times, most recently from 7e7114b to 3bdc29c Compare April 27, 2023 22:56
@elijahbenizzy elijahbenizzy changed the title WIP for fixing dangling nodes issue Fixes dangling nodes in subdag with extract_* Apr 27, 2023
If there was a subdag that carried a dangling node (E.G. one that was
not depended on by something within the subdag), and it was used by
'extract_fields', this would break. This occured because the
extract_fields decorator did not know which node to extract fields from,
as it looked for "final" nodes within the whole set of nodes produced by
the function, including those within the subdag.

This fix allow `@subdag` to modify it so we don't have this issue
anymore.

Currently, the way that the subdag indicates that its nodes are
"non-final" (e.g. they can't be the target of extract_columns) is
through a decorator. This can always be changed, but its not a bad way
to do it. Furthermore, this will happen *after* the resolution of any
subdags, ensuring that nesting subdags still works, as does any
decorators within subdags.
@elijahbenizzy elijahbenizzy force-pushed the subdag-dangling-nodes branch from 3bdc29c to f2169e4 Compare April 27, 2023 23:02
@elijahbenizzy elijahbenizzy requested a review from skrawcz April 27, 2023 23:11
@elijahbenizzy elijahbenizzy merged commit 0591028 into main Apr 28, 2023
@elijahbenizzy elijahbenizzy deleted the subdag-dangling-nodes branch April 28, 2023 04:16
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.

2 participants