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

get_values ignores the start string if no end string is specified #576

Open
maksam07 opened this issue Feb 20, 2023 · 3 comments
Open

get_values ignores the start string if no end string is specified #576

maksam07 opened this issue Feb 20, 2023 · 3 comments

Comments

@maksam07
Copy link

Describe the bug
get_values ignores the start string if no end string is specified.

To Reproduce
I want to get all rows starting from the second for the three columns, since the first row is the column headers.

rng = ws.get_values('A2', 'C', returnas='range')
print(rng)

But in response I get: <DataRange 'TEST'!A1:C1000>
I see the same thing in the other returnas values - the first row is the column header
If I write this code:

rng = ws.get_values('A2', 'C1000', returnas='range')

I will get the right answer: <DataRange 'TEST'!A2:C1000>

Why might there be such behavior?

System Information

  • OS: Kubuntu
  • pygsheets version : 2.0.6
  • pygsheets installed from (github or pypi): pypi
@nithinmurali
Copy link
Owner

I am unable to reproduce this. Does your sheet have some special characteristics? or is it a normal new sheet?

@maksam07
Copy link
Author

I am unable to reproduce this. Does your sheet have some special characteristics? or is it a normal new sheet?

Unfortunately, this is no longer relevant for the time being; I'm no longer doing that project. We can temporarily close this thread. If I ever come back to it, we'll talk again

@maksam07
Copy link
Author

maksam07 commented Jun 19, 2023

@nithinmurali

sh = gc.open_by_key('***')
ws = sh.worksheet_by_title('***')
print(ws.range('A1:C'))
print(ws.range('A2:C'))
print('*' * 20)
print(ws.range('A1:C5'))
print(ws.range('A2:C5'))

Output:

[[<Cell A1 '1'>, <Cell B1 '11'>, <Cell C1 '111'>], [<Cell A2 '2'>, <Cell B2 '22'>, <Cell C2 '222'>], [<Cell A3 '3'>, <Cell B3 '33'>, <Cell C3 '333'>], [<Cell A4 '4'>, <Cell B4 '44'>, <Cell C4 '444'>], [<Cell A5 '5'>, <Cell B5 '55'>, <Cell C5 '555'>], [<Cell A6 ''>, <Cell B6 ''>, <Cell C6 ''>], [<Cell A7 ''>, <Cell B7 ''>, <Cell C7 ''>], [<Cell A8 ''>, <Cell B8 ''>, <Cell C8 ''>], [<Cell A9 ''>, <Cell B9 ''>, <Cell C9 ''>], [<Cell A10 ''>, <Cell B10 ''>, <Cell C10 ''>]]
[[<Cell A1 '1'>, <Cell B1 '11'>, <Cell C1 '111'>], [<Cell A2 '2'>, <Cell B2 '22'>, <Cell C2 '222'>], [<Cell A3 '3'>, <Cell B3 '33'>, <Cell C3 '333'>], [<Cell A4 '4'>, <Cell B4 '44'>, <Cell C4 '444'>], [<Cell A5 '5'>, <Cell B5 '55'>, <Cell C5 '555'>], [<Cell A6 ''>, <Cell B6 ''>, <Cell C6 ''>], [<Cell A7 ''>, <Cell B7 ''>, <Cell C7 ''>], [<Cell A8 ''>, <Cell B8 ''>, <Cell C8 ''>], [<Cell A9 ''>, <Cell B9 ''>, <Cell C9 ''>], [<Cell A10 ''>, <Cell B10 ''>, <Cell C10 ''>]]
********************
[[<Cell A1 '1'>, <Cell B1 '11'>, <Cell C1 '111'>], [<Cell A2 '2'>, <Cell B2 '22'>, <Cell C2 '222'>], [<Cell A3 '3'>, <Cell B3 '33'>, <Cell C3 '333'>], [<Cell A4 '4'>, <Cell B4 '44'>, <Cell C4 '444'>], [<Cell A5 '5'>, <Cell B5 '55'>, <Cell C5 '555'>]]
[[<Cell A2 '2'>, <Cell B2 '22'>, <Cell C2 '222'>], [<Cell A3 '3'>, <Cell B3 '33'>, <Cell C3 '333'>], [<Cell A4 '4'>, <Cell B4 '44'>, <Cell C4 '444'>], [<Cell A5 '5'>, <Cell B5 '55'>, <Cell C5 '555'>]]

ws.range('A2:C') - still returns from the first line, unless a lower bound is specified on the right side

2023-06-19_13-42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants