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

Add condition parameter to get_column_values #511

Closed
djbelknapaw opened this issue Mar 3, 2022 · 2 comments · Fixed by #583
Closed

Add condition parameter to get_column_values #511

djbelknapaw opened this issue Mar 3, 2022 · 2 comments · Fixed by #583
Labels
enhancement New feature or request good first issue

Comments

@djbelknapaw
Copy link

Describe the feature

It would be handy if get_column_values had a condition that would stick a where <condition> in the query. I've got a big table and only want values from a subset of records.

Describe alternatives you've considered

  • Writing a macro of my own that grabs specifically what I want.
  • Pointing the get_column_values macro at a model that filters records for me, which leads to models that exist just for the filter.

Who will this benefit?

I have a big tall table with a whole bunch of key-value pairs that belong to different record types. I want to use pivot with a list of columns, but I want that list of columns to be specific to just one record type at a time.

Or more generally, maybe you want column values that only come from non-soft-deleted records (or myriad reasons why you might just want a subset).

Are you interested in contributing this feature?

I can probably contribute to this if you're open to this change.

@djbelknapaw djbelknapaw added enhancement New feature or request triage labels Mar 3, 2022
@joellabes
Copy link
Contributor

@djbelknapaw thanks for opening this! That use case makes sense, thanks for describing it (my gut reaction was "if you already know what you're filtering to, why do you need this at all" 😅)

I'd be happy to see a PR which adds this functionality and tests 👍 let me know if you need any help along the way!

@epapineau
Copy link
Contributor

epapineau commented May 11, 2022

Looks like I just opened a redundant issue #582 (sorry). I'd be happy to tackle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants