Skip to content

Commit

Permalink
fix(bug): comparing string and int
Browse files Browse the repository at this point in the history
  • Loading branch information
thanh-nguyen-dang committed Feb 4, 2020
1 parent 9d9692d commit d2e1e14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cdislogging==1.0.0
cryptography>=2.1.2
dictionaryutils==3.0.1
dictionaryutils==3.0.2
elasticsearch==6.3.1
elasticsearch-dsl==6.2.1
gen3datamodel==3.0.2
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
version='0.0.1',
install_requires=[
"cryptography>=2.1.2",
"dictionaryutils~=3.0.0",
"dictionaryutils~=3.0.2",
"hdfs==2.1.0",
"gen3datamodel~=3.0.0",
"gen3datamodel~=3.0.2",
"psqlgraph~=3.0.0",
"psycopg2~=2.8.4",
"pyspark~=2.4.4",
Expand Down
24 changes: 6 additions & 18 deletions tube/etl/indexers/injection/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def update_level(self):
just_assigned = set([])
for root in self.roots:
for child in root.children:
child.level = level
if len(child.children) == 0 or child in just_assigned:
continue
child.level = level
just_assigned.add(child)
assigned_levels = assigned_levels.union(just_assigned)

Expand All @@ -123,22 +123,10 @@ def update_level(self):
new_assigned = set([])
for collector in just_assigned:
for child in collector.children:
# TODO: PXP-5067 investigate int-string comparison in node lvls
# (Why were we assigning edge tbl names to leaf node lvls?)

# For now, commenting this out...
#if len(child.children) == 0 or child in assigned_levels:
# continue
#child.level = level
#new_assigned.add(child)

# ...and proposing this fix:
if child in assigned_levels:
continue
if len(child.children) == 0 or child in assigned_levels:
continue
child.level = level
if len(child.children) != 0:
new_assigned.add(child)

new_assigned.add(child)
just_assigned = new_assigned
assigned_levels = assigned_levels.union(new_assigned)
level += 1
Expand Down Expand Up @@ -174,7 +162,7 @@ def construct_reversed_collection_tree(self, flat_paths):
segments = list(p.path)
_, edge_up_tbl = get_edge_table(self.model, p.src, segments[0])
if p.src not in collectors:
collectors[p.src] = CollectingNode(p.src, edge_up_tbl)
collectors[p.src] = CollectingNode(p.src)
child = collectors[p.src]
if len(segments) > 1:
for fst in segments[0:len(segments)-1]:
Expand Down Expand Up @@ -205,7 +193,7 @@ def construct_auth_path_tree(self, flat_paths):
segments = list(p.path)
_, edge_up_tbl = get_edge_table(self.model, p.src, segments[0])
if p.src not in collectors:
collectors[p.src] = CollectingNode(p.src, edge_up_tbl)
collectors[p.src] = CollectingNode(p.src)
child = collectors[p.src]
if len(segments) > 1:
for node in segments[0:len(segments)-2]:
Expand Down

0 comments on commit d2e1e14

Please sign in to comment.