Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
3ca272b5
Commit
3ca272b5
authored
Dec 01, 2020
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed syntax errors
parent
31679a46
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
42 deletions
+4
-42
repository.py
...ta-hub/semantic-linking-microservice/app/db/repository.py
+0
-10
MessageHandler.py
...ntic-linking-microservice/app/messaging/MessageHandler.py
+1
-10
test_pipeline.py
.../semantic-linking-microservice/app/tests/test_pipeline.py
+0
-19
repository.py
...n/trace-retrieval-microservice/app/database/repository.py
+3
-3
No files found.
src/data-hub/semantic-linking-microservice/app/db/repository.py
View file @
3ca272b5
...
...
@@ -97,14 +97,4 @@ class Repository(MongoRepositoryBase):
projection
=
{
'_id'
:
0
})
return
list
(
entries
)
# #TODO redundant?
# def get_nodes_from_ids(self, unique_id_list: List) -> List[str]:
# result = list(super().get_entries(self._transaction_collection, projection={'_id': False}, selection={"UniqueID": { "$in": unique_id_list}}))
# if len(result) > 0:
# return result
# return []
# endregion
src/data-hub/semantic-linking-microservice/app/messaging/MessageHandler.py
View file @
3ca272b5
...
...
@@ -83,7 +83,7 @@ class MessageHandler:
return
nodes
=
[]
unique_id_list
=
[]
for
layer
in
layers
:
node
=
{}
...
...
@@ -95,15 +95,6 @@ class MessageHandler:
node
[
"table"
]
=
layer
.
table
node
[
"use_case"
]
=
layer
.
use_case
nodes
.
append
(
node
)
unique_id_list
.
append
(
node
[
"UniqueID"
])
#TODO redundant if we already check in trace?
# nodes_in_db = self._repository.get_nodes_from_ids(unique_id_list)
# if len(nodes_in_db) > 0: #found duplicates
# #remove duplicates from nodes:
# for node in nodes:
# if node["UniqueID"] in nodes_in_db:
# nodes.remove(node)
if
len
(
nodes
)
>
0
:
self
.
_repository
.
add_layer_nodes
(
nodes
)
...
...
src/data-hub/semantic-linking-microservice/app/tests/test_pipeline.py
View file @
3ca272b5
...
...
@@ -38,25 +38,6 @@ class DummyMongoRepo:
self
.
layernodes
.
extend
(
nodes
)
return
def
get_nodes_from_ids
(
self
,
unique_id_list
)
retList
=
[]
for
node
in
layernodes
:
# layers = self._repository.get_layers_for_use_case_and_table(use_case, table)
## if no local layers are found, fetch information from server
# if len(layers) == 0:
# layers = self._fetch_layer_information(use_case, table)
# self._repository.delete_layer(layer)
# self._repository.add_layer(layer)
#TODO
# nodes_in_db = self._repository.get_nodes_from_ids(unique_id_list)
class
Test_Pipeline
(
unittest
.
TestCase
):
handler
=
None
...
...
src/transaction-hub-in/trace-retrieval-microservice/app/database/repository.py
View file @
3ca272b5
...
...
@@ -18,7 +18,7 @@ class Repository(MongoRepositoryBase):
self
.
_transaction_collection
=
'transactions'
self
.
_failed_transaction_collection
=
'transactions_failed'
self
.
_duplicated_transactio
N
_collection
=
"transactions_duplicated"
self
.
_duplicated_transactio
n
_collection
=
"transactions_duplicated"
def
delete_all_transactions
(
self
):
collection
=
self
.
_database
[
self
.
_transaction_collection
]
...
...
@@ -62,12 +62,12 @@ class Repository(MongoRepositoryBase):
def
add_duplicated_transaction
(
self
,
transaction
:
Transaction
):
#transaction["timestamp"] = time.time()
super
()
.
insert_entry
(
self
.
_duplicated_transactio
N
_collection
,
transaction
.
to_serializable_dict
())
super
()
.
insert_entry
(
self
.
_duplicated_transactio
n
_collection
,
transaction
.
to_serializable_dict
())
def
all_duplicated_transactions_for_use_case
(
self
,
use_case
:
str
)
->
List
[
Dict
]:
result
=
super
()
.
get_entries
(
self
.
_duplicated_transaction_collection
,
projection
=
{
'_id'
:
False
},
selection
=
{
"use_case"
:
use_case
})
return
[
Transaction
.
from_serializable_dict
(
row
)
for
row
in
list
(
result
)]
def
delete_all_duplicated_transactions
(
self
,
use_case
:
str
):
collection
=
self
.
_database
[
self
.
_duplicated_transactio
N
_collection
]
collection
=
self
.
_database
[
self
.
_duplicated_transactio
n
_collection
]
collection
.
delete_many
({
"ApplicationType"
:
use_case
})
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment