Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column header naming convention is not checked #16

Open
chrwm opened this issue May 17, 2022 · 6 comments
Open

Column header naming convention is not checked #16

chrwm opened this issue May 17, 2022 · 6 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@chrwm
Copy link
Member

chrwm commented May 17, 2022

When uploading tables to the OEP using the script the column headers are not checked for capital letters and the table is nonetheless added to the DB.

I'm not sure whether this is a bug or problematic.

Example:

https://openenergy-platform.org/dataedit/view/model_draft/wind_turbine_domestic_lod_geoss_tp_oeo

grafik

@chrwm chrwm added the help wanted Extra attention is needed label May 17, 2022
@chrwm
Copy link
Member Author

chrwm commented Sep 13, 2022

oem2orm has no checks for the oedb table naming conventions. However, it should be implemented in oem2orm or in the API itself.

@jh-RLI
Copy link
Collaborator

jh-RLI commented Sep 13, 2022

The OEP API now checks for id fields and duplicate column names: OpenEnergyPlatform/oeplatform#1032

As far as I know, the API does not check for all table conventions (like capital letters).
@wingechr correct me if I'm wrong :)
The "create table" tool checks for uppercase letters, but other tools like oem2orm do not.
Since this is a compliance issue for the OEP, we should include such checks in the API. We should not trust user input and rely on other developers to implement all checks in their tools.

@chrwm
Copy link
Member Author

chrwm commented Sep 13, 2022

The same set of checks should apply for the Wizzard too.

@wingechr
Copy link

completely agree. i will have a look at the api side and if necessary implement name checks

@chrwm
Copy link
Member Author

chrwm commented Nov 24, 2022

Are there any updates on the issue?
I uploaded a table to test the status: https://openenergy-platform.org/dataedit/view/model_draft/umas_2021_05_18_resources_name_check_2

There're checks, however the error messages are heterogenous and should be improved. Not sure if the checks stem from the OEP API checks rather than sqlalchemy internal.

Implemented checks for columns headers

  1. starting col with number - bad/unspecific error message
  2. special characters - bad/unspecific error message
  3. capital letters - specific error message, but no column specified

@wingechr
Copy link

wingechr commented Dec 1, 2022

checks could be some regular expression, like [a-z][a-z0-9_]{0,62}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants