kragniz / kragniz/prettytable

In get_string, end is eval before sortby

Open
#58 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
What steps will reproduce the problem?
1. table = PrettyTable(["Count", "Data"])
2. add rows
3. print table.get_string(sortby="Count", reversesort=True, end=limit)

What is the expected output? What do you see instead?
Expected: Table should be sorted, then decide where to end
Actual: Table is grabbing the end index, then sorting (only beginning of table
to end limit provided is being sorted)

What version of the product are you using? On what operating system?
prettytable 0.7.2
Python 2.7.8
osx 10.9.4

Please provide any additional information below.

```

Original issue reported on code.google.com by `gr...@pagerduty.com` on 24 Sep 2014 at 8:10

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the get_string implementation and reproduce the issue with sortby="Count", reversesort=True, and end=limit using the steps in the report. Done means the complete table is sorted before the end limit is applied, with the expected rows returned.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.