You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default altair/vaga uses dots and brackets in in field names to access nested objects. Dots are quite common in field names and don't necessarily indicate nested attributes. One has to manually escape the dot.
I'm proposing to add an escape() function that does exactly that, it escapes a field name that contains a dot. I could implement the PR.
The implementation would look something like this:
Where should we put it? I don't know the project enough to have a qualified
oppinion. Maybe altair/utils/core.py?
Should the function be importable from the altiar top level package? I.e. it
can be used like this: alt.escape("foo.bar").
Ref taken from the docs:
Note: Dots (.) and brackets ([ and ]) can be used to access nested objects
(e.g., "field": "foo.bar" and "field": "foo['bar']").
If field names contain dots or brackets but are not nested,
you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]").
See more details about escaping in the field documentation.
This ticket is the result of the discussion in #284 (comment).
The text was updated successfully, but these errors were encountered:
Looking through some old issues, I am unsure about the value added here. It seems easier to type "foo\.bar" than alt.escape("foo.bar"). I will close this for now, but feel free to comment if you think it should be re-opened.
By default altair/vaga uses dots and brackets in in field names to access nested objects. Dots are quite common in field names and don't necessarily indicate nested attributes. One has to manually escape the dot.
I'm proposing to add an
escape()
function that does exactly that, it escapes a field name that contains a dot. I could implement the PR.The implementation would look something like this:
Questions:
oppinion. Maybe
altair/utils/core.py
?can be used like this:
alt.escape("foo.bar")
.Ref taken from the docs:
This ticket is the result of the discussion in #284 (comment).
The text was updated successfully, but these errors were encountered: