-
Notifications
You must be signed in to change notification settings - Fork 115
Fix variable shadowing crash in get_by_tags and code quality improvements #837
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
base: main
Are you sure you want to change the base?
Changes from all commits
7f1f8b5
524b5a6
c7108b9
4f4390c
7ae6362
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -277,8 +277,8 @@ def register_standard( | |
| # calculate gap analysis | ||
| populate_neo4j_db(db_connection_str) | ||
| jobs = [] | ||
| pending_stadards = collection.standards() | ||
| for standard_name in pending_stadards: | ||
| pending_standards = collection.standards() | ||
| for standard_name in pending_standards: | ||
| if standard_name == importing_name: | ||
| continue | ||
|
|
||
|
|
@@ -293,9 +293,9 @@ def register_standard( | |
| jobs.append(forward_job) | ||
| except exceptions.NoSuchJobError as nje: | ||
| logger.error( | ||
| f"Could not find gap analysis job for for {importing_name} and {standard_name} putting {standard_name} back in the queue" | ||
| f"Could not find gap analysis job for {importing_name} and {standard_name} putting {standard_name} back in the queue" | ||
| ) | ||
| pending_stadards.append(standard_name) | ||
| pending_standards.append(standard_name) | ||
|
|
||
|
Comment on lines
280
to
299
|
||
| bw_key = gap_analysis.make_resources_key([standard_name, importing_name]) | ||
| if not collection.gap_analysis_exists(bw_key): | ||
|
|
@@ -308,9 +308,9 @@ def register_standard( | |
| jobs.append(backward_job) | ||
| except exceptions.NoSuchJobError as nje: | ||
| logger.error( | ||
| f"Could not find gap analysis job for for {importing_name} and {standard_name} putting {standard_name} back in the queue" | ||
| f"Could not find gap analysis job for {importing_name} and {standard_name} putting {standard_name} back in the queue" | ||
| ) | ||
|
Comment on lines
310
to
312
|
||
| pending_stadards.append(standard_name) | ||
| pending_standards.append(standard_name) | ||
| redis.wait_for_jobs(jobs) | ||
|
Comment on lines
300
to
314
|
||
| conn.set(standard_hash, value="") | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -981,23 +981,23 @@ def get_by_tags(self, tags: List[str]) -> List[cre_defs.Document]: | |
| cre_where_clause.append(sqla.and_(CRE.tags.like("%{}%".format(tag)))) | ||
|
|
||
| nodes = Node.query.filter(*nodes_where_clause).all() or [] | ||
| for node in nodes: | ||
| node = self.get_nodes( | ||
| name=node.name, | ||
| section=node.section, | ||
| subsection=node.subsection, | ||
| version=node.version, | ||
| link=node.link, | ||
| ntype=node.ntype, | ||
| sectionID=node.section_id, | ||
| for db_node in nodes: | ||
| resolved = self.get_nodes( | ||
| name=db_node.name, | ||
| section=db_node.section, | ||
| subsection=db_node.subsection, | ||
| version=db_node.version, | ||
| link=db_node.link, | ||
| ntype=db_node.ntype, | ||
| sectionID=db_node.section_id, | ||
| ) | ||
| if node: | ||
| documents.extend(node) | ||
| if resolved: | ||
| documents.extend(resolved) | ||
| else: | ||
| logger.fatal( | ||
| "db.get_node returned None for" | ||
| "get_nodes() returned no documents for " | ||
| "Node %s:%s:%s that exists, BUG!" | ||
| % (node.name, node.section, node.section_id) | ||
| % (db_node.name, db_node.section, db_node.section_id) | ||
| ) | ||
|
Comment on lines
983
to
1001
|
||
|
|
||
| cres = CRE.query.filter(*cre_where_clause).all() or [] | ||
|
|
@@ -1582,7 +1582,6 @@ def add_node( | |
| ) -> Optional[Node]: | ||
| if not node: | ||
| raise ValueError(f"Node is None") | ||
| return None | ||
| dbnode = dbNodeFromNode(node) | ||
| if not dbnode: | ||
| logger.warning(f"{node} could not be transformed to a DB object") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in log message: duplicated word
for("job for for …").