Unnecessary variable loaded_fields
See original GitHub issueIf no fields exist we return None and exist the bulk_update.
However later we try to get loaded_fields here. But as fields will never be None or empty we will never use evaluate the get_fields
function again. So the variable loaded_fields should be unnecessary.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Why unnecessary variables are bad for your code - TechBeacon
Unnecessary variables are unnecessary liabilities. Variables are one of the most basic elements of programming. They're usually one of the first things you ......
Read more >Implementing an @export directive · Issue #3283 - GitHub
I want to implement an @export directive. This would export the value of a field into a variable that can be used in...
Read more >Do "unnecessary" variables matter that much? : r/PHP - Reddit
As I repeat, I'd like to know from everyone: how much do unnecessary variables influence my performance and does a single one of...
Read more >conditional field count - Qlik Community - 576785
Hi everyone! What I am trying to achieve is to wildcard match from all loaded fields and select those which have particular value....
Read more >Getting fields from layer calculated during process (output ...
Anyway, I have created the necessary variables as parameters. In the layer that I need to manipulate, and which is obtained from an ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
loaded_fields
is actually necessary.At this point
fields
can beNone
or an empty list. This difference is important.fields
is an empty list we exit thebulk_update
, as you said.fields
isNone
we go ahead. This happens when we don’t havemeta
norupdate_fields
. In this case we don’t know which fields we have to update, and since each object could have a different set of loaded variables, we have to callget_fields
for each one.[EDITED]
bulk_update
has an optional argument calledmeta
. Ifmeta
is not None we will use it to update all objects inobjs
. But if we don’t have this “global”meta
, we will use themeta
from the first object.When we don’t have this “global”
meta
norupdate_fields
is when we have to callget_fields
for each object.