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

Respect the cardinality of before_iteration clauses in the interpreter #73

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

zprobst
Copy link
Contributor

@zprobst zprobst commented Aug 15, 2023

In the interpreter component, you can specify two different blocks of interpretations. interpretations and before_iteration. The before_iteration block is applied for a record is broken down into sub-records and applied to the interpretations block.

Users can also specify lists of lists of interpretations in the interpretations block. Because both the interpreations block and before_iteration block are parsed and loaded the same way, its possible to supply a list of lists to the before_iteration block. However that is not respected in anyway. This provides a confusing experience to users that try and use this.

To resolve this, this PR iterates over each sublist in before_iteration If provided, and performs the iteration and interpretation based on the output of each sublist provided. This creates an experience consistent with the use of the interpretation block.

@zprobst zprobst requested a review from ccloes as a code owner August 15, 2023 20:01
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #73 (9e5e682) into main (0ee9ca8) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #73   +/-   ##
=======================================
  Coverage   93.73%   93.73%           
=======================================
  Files         121      121           
  Lines        3032     3032           
=======================================
  Hits         2842     2842           
  Misses        190      190           
Flag Coverage Δ
3.10 93.73% <100.00%> (ø)
3.11 93.73% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
nodestream/interpreting/interpreter.py 97.14% <100.00%> (ø)

@zprobst zprobst merged commit b8707db into main Aug 22, 2023
4 checks passed
@zprobst zprobst deleted the fix/respect-before-iteration-cardinality branch August 22, 2023 11:49
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