-
Notifications
You must be signed in to change notification settings - Fork 482
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
Ref/sqlalchemy session #2712
Ref/sqlalchemy session #2712
Conversation
@@ -305,6 +355,7 @@ def create_component(self, info: t.Dict): | |||
with self.session_context() as session: | |||
stmt = insert(self.component_table).values(**new_info) | |||
session.execute(stmt) | |||
# self._cache.add_metadata(new_info) |
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.
Intended?
class Cache: | ||
def __init__(self): | ||
self._uuid2metadata: t.Dict[str, t.Dict]= {} | ||
self._type_id_identifier2metadata = defaultdict(dict) |
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.
Rename
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.
type_id
+ identifier
potentially will go wrong - what is the need of this?
logging.info(f'Apply took {time.time() - start} seconds') | ||
logging.info(data_backend.global_time) | ||
logging.info(data_backend.global_count) | ||
data_backend.global_time = Counter() |
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.
What's this?
return self._uuid2metadata.get(uuid) | ||
|
||
def get_metadata_by_identifier(self, type_id, identifier, version): | ||
metadata = self._type_id_identifier2metadata[(type_id, identifier)] |
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.
[type_id, identifier]
works
Description
Related Issues
Checklist
make unit_testing
andmake integration-testing
successfully?Additional Notes or Comments