Skip to content

Comments

Refactor: change row_factory from tuple to dict#161

Open
Manitary wants to merge 2 commits intor-anime:masterfrom
Manitary:test-database-keyword-args
Open

Refactor: change row_factory from tuple to dict#161
Manitary wants to merge 2 commits intor-anime:masterfrom
Manitary:test-database-keyword-args

Conversation

@Manitary
Copy link
Contributor

I noticed the comment about having order-sensitive arguments in classes initialisation so I gave it a try: by changing row_factory to a dict you can pass the result of the query as kwargs with **

I assigned some default values as I saw fit based on the existing code; there is some naming mismatch between the tables and the class attributes, I used some aliases as I did not want to propose changes that would require altering the schema.

I think I adjusted all instances affected by this change; by the logs, the modules setup, edit, update, and episode seemed to work as intended.

Make arguments in class initialisation not order-sensitive
Adjust existing calls to match the new format
Assign some default values based on existing calls
Fix inconsistent indentation
@Manitary Manitary force-pushed the test-database-keyword-args branch from ae22257 to b08843b Compare June 23, 2023 10:04
Supports both tuple and mapping, can be cast to dict if needed
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.

1 participant