question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading files with unrecognized tags

See original GitHub issue

Often I find that I want to be able to load YAML files even if they contain unrecognized tags. Currently, attempting to do so will result in an error, although I’m not sure why that should be the case. Instead of throwing an error for an unrecognized tag, it seems perfectly reasonable to issue a warning and simply return a raw data structure rather than a constructed instance of some type.

The change log says that warnings were changed to errors for unrecognized tags in version 3.4.0. What was the reasoning for this? Are you willing to revert to the old behavior? A better solution might be to add an optional argument to the load* functions that controls whether unrecognized tags cause warnings or errors.

If this seems like a reasonable approach, I am potentially willing to submit a PR with the necessary changes.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
bigunyakcommented, Aug 28, 2018

I’m here just to mention that the requested feature is a very typical use case for someone who simply wants to load a yaml file with some tags to only change a few parameters and dump the data again. As an example, I hit that problem with unrecognized tags when tried to load my AWS CloudFormation template which contains !Ref and !GetAtt tags to only change a few parameters and dump it again. Please, consider the original request and maybe reopen the issue.

0reactions
bigunyakcommented, Oct 13, 2018

@andrewryan1906 no, I used other approaches. First, I used awk to edit original template and it worked fine but then I realised that CloudFormation Parameters is the cleanest way to solve my task.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I load custom Django tags from a file? - Stack Overflow
This works fine when I'm using a Django project with a settings.py and INSTALLED_APPS -- I append 'myapp' to the list and place...
Read more >
Re: [Geany-Users] Tag file loading fails - The Mail Archive
Hi I added that now. Still says unable to load tag file. filetype_extensions.conf says txt=*.txt; I removed everything else from it and only ......
Read more >
Create and use custom template tags | PyCharm Documentation
Use a quick-fix to resolve the missing reference. Place the caret at the custom tag name, press Alt+Enter , and select the file...
Read more >
How to create custom template tags and filters
You can extend the template engine by defining custom tags and filters using Python, and then make them available to your templates using...
Read more >
Best practices for tags and tag managers - web.dev
To avoid impacting page load, it is recommended to fire non-essential tags after Window Loaded . Use custom events #. Custom events allow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found