-
Notifications
You must be signed in to change notification settings - Fork 44
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
Change aliasing method names in mapper and deprecate the old #746
Conversation
e41644d
to
b0e2949
Compare
Codecov Report
@@ Coverage Diff @@
## master #746 +/- ##
==========================================
+ Coverage 92.77% 92.79% +0.01%
==========================================
Files 68 68
Lines 3655 3663 +8
==========================================
+ Hits 3391 3399 +8
Misses 264 264
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
field: Field name to be de-aliased. | ||
|
||
Returns: | ||
De-aliased field name, falling back to returning `field`. | ||
|
||
""" | ||
field = field.split(".")[0] |
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.
I removed this line from the "new" method as it is not tested anywhere and therefore should not be relied on for anything; I think it may just be left over from when alias_for
was modified to make this method. If you ask for the OPTIMADE field of e.g. my_weird_field.with_dots
, you would want it to return my_weird_field.with_dots
rather than alias_for_my_weird_field
even if the dot has some significance for that particular backend.
b0e2949
to
f2b10fe
Compare
Is this what you had in mind @CasperWA? |
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.
I checked the doc string warnings with mkdocs serve
and it didn't show correctly. I think the additional explamation point should do it?
Added a sentence about the dot-splitting of get_backend_field()
as well, feel free to adapt it as you see fit.
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.
After some testing locally, this seems to fix the admonition in the documentation (edited the previous suggested changes to match).
Co-authored-by: Casper Welzel Andersen <[email protected]>
Co-authored-by: Casper Welzel Andersen <[email protected]>
Thanks @CasperWA; I've just noticed that our CI doesn't do a proper rebuild of the docs for pull requests. We should probably fix this, as the elasticsearch docs aren't currently being tested. I'll raise an issue |
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.
Cheers @ml-evs
Closes #667.