-
Notifications
You must be signed in to change notification settings - Fork 0
Excel to entities #56
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! can you add some testing and some excels where to do this?
Also, I added a few minor comments on minor design this you can decide if accept or just keep doing it with your style.
Then, one open point: some code doing checks on the format is commented out. We would actually like to keep this, right? Is this the issue you were having with the logger?
"Section", | ||
"Property label", | ||
"Data type", | ||
"Vocabulary code", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add "Object code"
commented out? This is because in the excel import system is missing, but for our Python and other stuff we need this information when the Data type
is OBJECT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, but you mean to have it there for future versions of the Excel files that will contain also the header "Object code"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, now I am not so sure; this is something internal from openBIS, but it looks like a bug to me: we need to somehow define the code of the object for when a property is of dataType OBJECT
Otherwise, how do we know the object that an assigned property is referring to?
entity_type = sheet[entity_type_position].value | ||
|
||
entity_types = [ | ||
"OBJECT_TYPE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need both OBJECT_TYPE and SAMPLE_TYPE here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because right now the entity types of type "OBJECT" appear in the excel as "SAMPLE_TYPE". This naming was deprecated in favour of "OBJECT_TYPE", but until this happens, I think is nice to allow the system to recognize both, until we have a definitive version, and is not changing the behaviour of the script in any way.
) | ||
# return "\n".join(errors) | ||
else: | ||
if entity_type == "SAMPLE_TYPE" or entity_type == "OBJECT_TYPE": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for readability, this and the previous ifs in the terms_to_dict
could be part of a class and methods applied to each type. There you can identify common abstracted methods to be applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can discuss this
Pull Request Test Coverage Report for Build 13010536952Details
💛 - Coveralls |
bam_masterdata/cli/cli.py
Outdated
(Optional) The path to the Masterdata Excel file. | ||
""", | ||
) | ||
def fill_masterdata(url, path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have to change path to excel_file in this function
maybe click has another option for aliases if you prefer so
Ok, I went locally through the branch and I got some points:
|
…ython model entities
a3cc1ed
to
830362b
Compare
Added str_to_bool function Fix mypy in excel_to_entities Added tmp/ to gitignore
No description provided.