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.

checking lazy lookup for None value

See original GitHub issue

with the current tvdb problems i tried to check for when some tvdb entries are not available (when they are None)

so i tried different if conditions but none of them worked here is what i tried

if:
  - tvdb_ep_name != 'None':
      set:
        content_filename: '{{ tvdb_series_name }} {{ tvdb_absolute_number }} - {{tvdb_ep_name }}'

this check passes for some reason even though it returns None when setting the filename also tried those tvdb_ep_name is not None and tvdb_ep_name is defined but they gave an error!

is there something that i am doing wrong? something i am missing?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
gazpachokingcommented, Dec 5, 2019

The Nones are falsey, and would trigger the fallback.

https://jinja.palletsprojects.com/en/2.10.x/templates/#default

We actually change the boolean option of the default filter to True in FlexGet to cause that behavior.

0reactions
astroteecommented, Dec 5, 2019

ok, thank you so much for the clarification

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to force Lazy<T> object to create/re-create value?
I use the below code the call this function. But it always creates new value because IsValueCreated value is always false. LookupCache.
Read more >
Swift lazy initializer with lookup ability if value equals nil
We want the value been stored once it's off nil. The property mentioned above is helpful in these scenarios: File directory lookup; DB...
Read more >
Excel Factor 15 The Lazy Lookup - My Online Training Hub
I call this technique the Lazy Lookup, and there's nothing wrong with being ... and it instructs Excel to find the value in...
Read more >
allow non lazy evaluation of variables · Issue #10374 - GitHub
The trick is in lookup() function which does evaluate vars on it's way. This will not work with {{ vars['go'] }} , {{...
Read more >
PEP 690: Lazy Imports - Discussions on Python.org
It would be nice to have a function which returns whether a module is import-deferred (ie it checks whether the passed object's __dict__...
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