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

Escaping special chars in col names with a single backslash raises warnings #3410

Closed
joelostblom opened this issue Apr 25, 2024 · 1 comment · Fixed by #3411
Closed

Escaping special chars in col names with a single backslash raises warnings #3410

joelostblom opened this issue Apr 25, 2024 · 1 comment · Fixed by #3411
Labels

Comments

@joelostblom
Copy link
Contributor

What happened?

When I run the example with special chracters from the docs, I see a bunch of warnings:

image

What would you like to happen instead?

Replacing the single \ with double \\ fixes the issue. We could just update the docs, but before doing so I'm curious if anyone knows if something changed (in altair/ipython/python) that makes this warning visible now and if others see it or it is something with my local env.

Which version of Altair are you using?

main

@jonmmease
Copy link
Contributor

Rather than using double backslashes, I think using raw strings (those prefixed by r, e.g. r'col\.period') would fix the issue by bypassing Pythons own escaping logic. And I think this makes things a little easier to reason about.

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

Successfully merging a pull request may close this issue.

2 participants