Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Add the ability to sort by multiple columns #4

Merged
merged 1 commit into from
Dec 30, 2018

Conversation

redfern314
Copy link
Owner

  • Sort columns will be processed in the order given
  • Additional columns will "break ties" between previous sort columns
  • Column names tweaked for argument clarity

@jipis - want to try this branch out (re: #3) and let me know if this resolves your issue?

Sample queries:
python southwest.py -a SFO -d PDX -t 2019-05-05 2019-05-06 -s depart_date -l
python southwest.py -a SFO -d PDX -t 2019-05-05 2019-05-06 -s depart_date depart_time -l
python southwest.py -a SFO -d PDX -t 2019-05-05 2019-05-06 -s depart_date depart_time fares -l
python southwest.py -a SFO -d PDX -t 2019-05-05 2019-05-06 -s depart_date depart_time fares -l --reverse

 * Sort columns will be processed in the order given
 * Additional columns will "break ties" between previous sort columns
 * Column names tweaked for argument clarity
@jipis
Copy link
Contributor

jipis commented Dec 26, 2018

For departures, works great. For sorting by arrival time with multiple dates, it's kinda weird when the arrival time is the next day. That's actually what it was doing before too, though. A potential fix could be to see if the arrival time is before the departure time and then add 24 hours to it because it's (likely? definitely?) an indication that the arrival date is the next day? Really only helpful for sorting because the human looking at the data likely knows what he's looking at.

At some point, trying to cover all of the bases, though, is probably a little nuts. What you've got here does, indeed, fix the sorting ambiguity with multiple departure dates.

@redfern314
Copy link
Owner Author

I think I'll call this good for now. Agree it's a little weird for arrival, but I'll wait until someone raises an issue for it before I try to solve it. Thanks for testing!

@redfern314 redfern314 merged commit 1ac5bf9 into master Dec 30, 2018
@redfern314 redfern314 deleted the feature/sort-improvements branch December 30, 2018 20:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants