alces-software / adminware

A sandbox CLI for running commands remotely across nodes
1 stars 0 forks source link

Abstract away the query object #128

Closed WilliamMcCumstie closed 5 years ago

WilliamMcCumstie commented 5 years ago

Currently there is a job_data object that is generated from an SQL query. As the query contains an aggregate function, some of the data is not stored on the Job model. This make passing the data around problematic as it needs to be unpacked.

As a result, a lot of the resultant code needs to know the exact format of the job_data object. Instead this format should be abstracted behind an adaptation layer. This way changes in the query don't affect the rest if the code.

See this commit for further details: https://github.com/alces-software/adminware/pull/124/commits/24954ca7c264ee9601c8ba28fb9f0c9e387c9718

WilliamMcCumstie commented 5 years ago

Related to the SQL query is unpacking the data. Currently there is a standalone method shared_job_data_table that is responsible for creating a table from the data. However this has created very tightly coupled code.

Instead the data should be unpacked in a different way. Possible store the num_passed_runs on the job object itself?

Regards less, this comment needs to be resolved: https://github.com/alces-software/adminware/pull/141#pullrequestreview-171509255