Skip to content

Conversation

@akx
Copy link
Collaborator

@akx akx commented Mar 22, 2021

It seems to work... Got ideas for better test cases?

Fixes #15

@akx akx added bug Something isn't working enhancement New feature or request labels Mar 22, 2021
@akx akx requested a review from japsu March 22, 2021 14:15
@japsu
Copy link
Collaborator

japsu commented Mar 22, 2021

@akx in your opinion, should this work (it doesn't)?

@pytest.mark.xfail
def test_recursive_data_structure():
template = Template.parse('''
!Defaults
x:
y: 5
x: !Var x
---
five: !Lookup x.y
also_five: !Lookup x.x.x.x.x.y
''')
assert template.enrich({}) == [{'five': 5, 'also_five': 5}]

Copy link
Collaborator

@japsu japsu left a comment

Choose a reason for hiding this comment

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

Regardless of the new failing test I added, LGTM & make a new issue about recursive data structures.

@japsu
Copy link
Collaborator

japsu commented Mar 22, 2021

Also once this is merged, let's release 0.3.0. We've added new tags and this change may introduce subtle changes in the degree of laziness, so incrementing the minor is warranted (would probably be 2.0.0 if we were already 1.x).

@japsu
Copy link
Collaborator

japsu commented Mar 22, 2021

See examples/peano.yml, uncomment five.

five:
- - []
two:
- - []

🤔⁉️

@akx
Copy link
Collaborator Author

akx commented Mar 22, 2021

@akx in your opinion, should this work (it doesn't)?

As far as correctness goes, it should, shouldn't it?

@akx akx marked this pull request as ready for review July 27, 2021 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

!Lookup does not enrich on the fly

3 participants