Skip to content

Remove get_all_asset_data function from the code#10208

Open
yabirgb wants to merge 1 commit into
rotki:developfrom
yabirgb:remove-function
Open

Remove get_all_asset_data function from the code#10208
yabirgb wants to merge 1 commit into
rotki:developfrom
yabirgb:remove-function

Conversation

@yabirgb

@yabirgb yabirgb commented Jun 27, 2025

Copy link
Copy Markdown
Member

Closes #(issue_number)

Checklist

  • The PR modified the frontend, and updated the user guide to reflect the changes.

@yabirgb yabirgb marked this pull request as ready for review June 30, 2025 12:18
asset_type: AssetType = field(init=False)
name: str = field(init=False)

def get_asset_data(self) -> dict[str, Any]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. why not make it a TypedDict?
  2. why not move this method the Asset class?

]

def _parse(self, connection: 'DBConnection', insert_text: str) -> AssetData:
def _parse(self, connection: 'DBConnection', insert_text: str) -> dict[str, Any]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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.

2 participants