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

Use field value as function parameter #36

Open
aguspina opened this issue Mar 23, 2021 · 0 comments
Open

Use field value as function parameter #36

aguspina opened this issue Mar 23, 2021 · 0 comments

Comments

@aguspina
Copy link

I'm trying to exec this query in Superset-SQLab

SELECT {{gender_enum(users.gender)}} as gender
from users;

The gender_enum is defined like this

lambda x: ['Femenino', 'Masculino', 'Otro', 'Prefiere no decir'][x]

The gender field could be 0, 1, 2 or 3. It's an enum.

Of course, in jinja context, users.gender does not exist. I'm not finding a way to solve this, can you help me please?

Thanks!!

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

No branches or pull requests

1 participant