Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Ref/sqlalchemy session #2712

wants to merge 3 commits into from

Conversation

jieguangzhou
Copy link
Collaborator

Description

Related Issues

Checklist

  • Is this code covered by new or existing unit tests or integration tests?
  • Did you run make unit_testing and make integration-testing successfully?
  • Do new classes, functions, methods and parameters all have docstrings?
  • Were existing docstrings updated, if necessary?
  • Was external documentation updated, if necessary?

Additional Notes or Comments

@@ -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)
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename

Copy link
Collaborator

@blythed blythed Jan 3, 2025

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()
Copy link
Collaborator

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)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[type_id, identifier] works

@kartik4949 kartik4949 closed this Jan 4, 2025
@blythed blythed deleted the ref/sqlalchemy_session branch January 13, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants