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

Option to error on missing Jinja2 variables #27

Merged
merged 2 commits into from
May 22, 2024

Conversation

DavidHuber-NOAA
Copy link
Collaborator

Description

This allows a user to specify if they want to allow missing variables in a jinja2 template. If allow_missing == False, a NameError will be raised with the name of the variable that is undefined. The default is True, which is the current behavior.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • pynorms
  • pytests

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes need updates to the documentation. I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing tests pass with my changes

@DavidHuber-NOAA DavidHuber-NOAA requested a review from aerorahul May 22, 2024 14:48
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.93%. Comparing base (71f6b10) to head (df2875c).
Report is 9 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #27      +/-   ##
===========================================
+ Coverage    47.87%   47.93%   +0.06%     
===========================================
  Files           18       18              
  Lines         1650     1650              
  Branches       335      335              
===========================================
+ Hits           790      791       +1     
+ Misses         801      799       -2     
- Partials        59       60       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

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

looks good.
Thanks for adding a test!

@aerorahul aerorahul merged commit 8406bee into NOAA-EMC:develop May 22, 2024
9 checks passed
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