Skip to content

Commit 4745fe6

Browse files
committed
remove list() conversion
1 parent fae54a7 commit 4745fe6

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

pharus/component_interface.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,13 @@ def __init__(
159159
for s, t in (_.split(".") for _ in component_config["tables"])
160160
]
161161
self.parents = sorted(
162-
list(
163-
set(
164-
[
165-
p
166-
for t in self.tables
167-
for p in t.parents(as_objects=True)
168-
if p.full_table_name
169-
not in (t.full_table_name for t in self.tables)
170-
]
171-
)
162+
set(
163+
[
164+
p
165+
for t in self.tables
166+
for p in t.parents(as_objects=True)
167+
if p.full_table_name not in (t.full_table_name for t in self.tables)
168+
]
172169
),
173170
key=lambda p: p.full_table_name,
174171
)
@@ -211,9 +208,7 @@ def dj_query_route(self):
211208
return "Insert successful"
212209

213210
def fields_route(self):
214-
parent_attributes = sorted(
215-
list(set(sum([p.primary_key for p in self.parents], [])))
216-
)
211+
parent_attributes = sorted(set(sum([p.primary_key for p in self.parents], [])))
217212
source_fields = {
218213
**{
219214
(p_name := f"{p.database}.{dj.utils.to_camel_case(p.table_name)}"): {

0 commit comments

Comments
 (0)