Skip to content

!Lookup does not enrich on the fly #15

Description

@japsu

Template:

!Defaults
x:
  y: 5
z: !Var x
---
workie: !Lookup x.y
no_workie: !Lookup z.y

Expected output:

workie: 5
no_workie: 5

Actual output:

Traceback (most recent call last):
  File "/usr/local/bin/emrichen", line 11, in <module>
    load_entry_point('emrichen', 'console_scripts', 'emrichen')()
  File "/Users/sapaj1/Hobby/emrichen/emrichen/__main__.py", line 111, in main
    output = template.render(context, format=args.output_format)
  File "/Users/sapaj1/Hobby/emrichen/emrichen/template.py", line 22, in render
    enriched = self.enrich(context)
  File "/Users/sapaj1/Hobby/emrichen/emrichen/template.py", line 19, in enrich
    return context.enrich(self.template)
  File "/Users/sapaj1/Hobby/emrichen/emrichen/context.py", line 37, in enrich
    item = self.enrich(item)
  File "/Users/sapaj1/Hobby/emrichen/emrichen/context.py", line 30, in enrich
    val = self.enrich(val)
  File "/Users/sapaj1/Hobby/emrichen/emrichen/context.py", line 21, in enrich
    return self.enrich(value.enrich(self))
  File "/Users/sapaj1/Hobby/emrichen/emrichen/tags/lookup.py", line 19, in enrich
    raise KeyError(f'{self}: no matches for {self.data}')
KeyError: "Lookup('z.y'): no matches for z.y"

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions