Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Dlacoste esrf/abstract reader draft #20

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sergirubio
Copy link
Collaborator

Hi Damien,

I have corrected some issues on AbstractReader, added a simple main method to call it from shell and added the mariadb_reader as example for implementation.

Tomorrow I can make a little demo during the meeting,

Sergi

@dlacoste-esrf
Copy link

Seems really good!
Can we find a way to use the AbstracteReader as the entrypoint for clients ? maybe in the init, replace this YourDb call by calling an implementation module that could be provided as an argument ?

Another thing, for the column selection, can we use a list (that could be column names or indexes btw) instead of a single string ? I find it a bit weird as it is.

I'll start working on the timescaledb implementation on my side and we can start building on this ! That's really good, many thanks!

@sergirubio
Copy link
Collaborator Author

sergirubio commented Sep 17, 2021 via email

@dlacoste-esrf
Copy link

Sorry for the late answer. I am not sure to get what you want to do…

If we could use something like

import AbstractReader

reader=AbstractReader(mariadb_reader, config={host:"",password:""})

and we just replace mariadb_reader by any implementation of our choice, the import, and error management in case the module does not exist, would be managed at the AbstractReader level. We could rename it as well, it wouldn't be so abstract in the end…

@dlacoste-esrf
Copy link

dlacoste-esrf commented Nov 5, 2021

I started working on a timescaledb implementation and it raised a little question.

For the columns, you added this argument so that we can select the columns we want to extract. I am afraid it can be problematic if the column names are implementation related…
I would create an enum or something to represent the common fields (id, time, value_r/w, error_desc, quality factor, …), pass them as a proper list, and leave the naming to the implementation, leaving an extra argument, that can be a string, for custom extra fields. Time might necessit a different treatment, as we use it to order the data, I would suggest we extract it all the time anyways.

Make me think of the error_desc actually, upon extraction should we return the message itself or simply the id ?

Thanks in advance for your feedback

@dlacoste-esrf
Copy link

I merged your modifications in my fork and pushed a first timescaledb implementation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants