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

Infer sort_direction from query #48

Closed
wants to merge 2 commits into from

Conversation

bernardd
Copy link
Contributor

This change automates detection of the sort_direction field based on the sort ordering in the query. It also enables per-field sort direction, as supported by #34, but does so without the need to explicitly specify them. I've taken the extra tests from #34 and included them in this change (with the addition of explicitly specified amount values on all test data, since the randomly generated values were causing inconsistent test results with those new tests).

@bernardd bernardd changed the title Automatic sort Infer sort_direction for query Dec 10, 2018
@bernardd bernardd changed the title Infer sort_direction for query Infer sort_direction from query Dec 10, 2018
@Nickforall
Copy link
Contributor

This is a duplicate of #41, which in its place is also blocked by #34.

I am also sure we do not want to remove sort_direction entirely. I have a couple of production cases where my order-bys are not the same as the sort_direction.

(with the addition of explicitly specified amount values on all test data, since the randomly generated values were causing inconsistent test results with those new tests).

The reason why this was happening in your test results is because I made sure that my random values where always higher than 10 for amount, thus not clashing with the tests asserting ascending sort directions on low values. Though having more reliable amount values may be better here.

amount: :rand.uniform(100) + 10,

@bernardd
Copy link
Contributor Author

This is a duplicate of #41, which in its place is also blocked by #34.

Ah dangit. Got confused by the title of #41 and didn't look at it closely. Okay, so if those both work and are ready to go, what do we need to do to unstick them and get them merged? If it's just docs, I'll put together some myself tomorrow (already night here).

The reason why this was happening in your test results is because I made sure that my random values where always higher than 10 for amount, thus not clashing with the tests asserting ascending sort directions on low values. Though having more reliable amount values may be better here.

Yeah, I figured that out. I'm not bothered which solution gets used - random + 10 is just as good to my mind.

@Nickforall
Copy link
Contributor

Nickforall commented Dec 10, 2018

If it's just docs, I'll put together some myself tomorrow (already night here).

It's just docs afaik, and I haven't heard from @stevedomin since then.
It'd be great to get this going, as I have some other features ready we use in an internal fork, and they are all blocked by #34.

@bernardd
Copy link
Contributor Author

@Nickforall It might be time to accept that @stevedomin won't be back, at least for a while :) If you have an internal branch all set up and ready to go, how would you feel about publishing it? I'd rather not have multiple of us all working on the same stuff on different repos :)

@bernardd
Copy link
Contributor Author

Going to close this and focus on trying to get #41 merged

@bernardd bernardd closed this Mar 14, 2019
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

Successfully merging this pull request may close these issues.

2 participants