From b3c9ba7ebfedfe2b30915fbd661cef5c855c7a4d Mon Sep 17 00:00:00 2001 From: cbrianbet Date: Mon, 9 Dec 2024 07:46:43 -0800 Subject: [PATCH] Update routes/dictionary_mapper_api.py Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- routes/dictionary_mapper_api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routes/dictionary_mapper_api.py b/routes/dictionary_mapper_api.py index 3733fd5..469bf67 100644 --- a/routes/dictionary_mapper_api.py +++ b/routes/dictionary_mapper_api.py @@ -361,8 +361,7 @@ async def load_data(baselookup:str, db_session: Session = Depends(get_db)): def expected_variables_dqa(data, lookup): valid_match = True try: - dictionary = DataDictionaries.objects.filter(name=lookup).first() - if dictionary: + if dictionary := DataDictionaries.objects.filter(name=lookup).first(): dictionary_terms = DataDictionaryTerms.objects.filter(dictionary_id=dictionary.id).all() for term in dictionary_terms: column_data = data.get(term.term)