Remove get_all_asset_data function from the code#10208
Open
yabirgb wants to merge 1 commit into
Open
Conversation
| asset_type: AssetType = field(init=False) | ||
| name: str = field(init=False) | ||
|
|
||
| def get_asset_data(self) -> dict[str, Any]: |
Contributor
There was a problem hiding this comment.
- why not make it a
TypedDict? - why not move this method the
Assetclass?
| ] | ||
|
|
||
| def _parse(self, connection: 'DBConnection', insert_text: str) -> AssetData: | ||
| def _parse(self, connection: 'DBConnection', insert_text: str) -> dict[str, Any]: |
Contributor
There was a problem hiding this comment.
why change the return data type to a dict instead of the AssetData?
Comment on lines
+545
to
+550
| with GlobalDBHandler().conn.read_ctx() as cursor: | ||
| cursor.execute('SELECT identifier FROM assets') | ||
| all_identifiers = [row[0] for row in cursor] | ||
|
|
||
| for identifier in all_identifiers: | ||
| asset_data = GlobalDBHandler.get_asset_data(identifier, form_with_incomplete_data=False) |
Contributor
There was a problem hiding this comment.
i get that this is a test but this is expensive as you can get the data once. it can be a test utility function so you can reuse it below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #(issue_number)
Checklist