-
Notifications
You must be signed in to change notification settings - Fork 118
View subset search #751
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
View subset search #751
Conversation
added include_elements filter to get_all function. Setting to false will return view object without element details, a potentially much faster query.
search across cubes for any views with specified dim subset. returned object is list of view objects
|
Something like this seems to work for a OData query to find any views that contains a given dim and subset. Note the type filter using Note sure i'd necessarily pick it over the approach you've taken but it's good to know it's possible through OData. |
|
Hi, nice work @adscheevel and @gbryant-dev. Thanks! I assume the odata query does the filtering more efficiently. I think we should implement the search function based on the query. In any case, I think we should merge the change that the view skips the element names. That's a useful feature. |
|
Thanks @gbryant-dev! I agree an odata query would be preferred and almost surely more efficient. The only issue I have with this query is that it will return a list of all cubes and the matching views for each cube. The result will be a bunch of cubes with null results. This can easily be cleaned up on the python side but it would be nice to have the cube list filtered too, that is a filter both inside and outside of the $expand statement. |
|
It's possible but I can't find a better way of doing it without duplicating the filter like this:
|
removed search_subset function, will add odata query to view service
find all views with subset. similar to prior work in cube service that is now superseded by this
|
I was afraid of that, knew the filter would need to be present in both places but wasn't sure how messy it'd be. My latest commit 4da336c splits the difference and uses @gbryant-dev's filter in the expand statement and then filters out the null view collections via python. I removed my original function in cube service via this commit 4591636. |
|
Nice work! I will review and add tests |
gbryant-dev
left a comment
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've left some comments 🙂
updated name on subset search so clear it's for native views
added select statement to cube on subset search function
changed to f string for proper single quote handling when cube_name specified
added better view list generation when cube_name specified, other minor refactoring
updated url for subset and dim to be case and space insensitive
|
Thank you @gbryant-dev for the suggestions and review of my poorly tested code! |
|
Closed in favor of #752 Hi @adscheevel, @gbryant-dev, I add some tests to the code. Please approve #752 and I will merge the changes. |
Method for finding views that contain specified dim/subset as requested in this issue: #738 (comment)
I included an enhancement to the get_all function in View Service to specify whether or not the returned list of views should include elements. By excluding the element list, the get_all function leveraged by this new search method runs 10x faster.
I put the subset search function in the cube service as I needed to leverage the get_names_with_dimension function and didn't want to mess with the dependencies.
Ideally, there would be a good odata query to do all of this right in the URL, but that's proving somewhat complex.