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

Ignore Numericising Specific Columns in get_all_records #701

Merged
merged 7 commits into from
Apr 10, 2020
Merged

Ignore Numericising Specific Columns in get_all_records #701

merged 7 commits into from
Apr 10, 2020

Conversation

chrischansonichu
Copy link
Contributor

@chrischansonichu chrischansonichu commented Oct 16, 2019

Allows passing in a list of column indices (1-indexed) to avoid numericising them in the get_all_records method, also allows for the special case ['all'] to avoid numericising all columns. Fixes #581, #568, #231 Improvement over my previously-closed PR of #598.

Allows passing in a list of column indices (1-indexed) to avoid numericising them in the get_all_records method, also allows for the special case ['all'] to avoid numericising all columns.
@burnash
Copy link
Owner

burnash commented Mar 30, 2020

@benjamindhimes Thank you very much for your contribution. I'm really sorry for the late response and I appreciate your persistence. I'll review the PR shortly.

gspread/models.py Outdated Show resolved Hide resolved
@chrischansonichu chrischansonichu requested a review from burnash April 1, 2020 17:03
gspread/utils.py Outdated Show resolved Hide resolved
@chrischansonichu chrischansonichu requested a review from burnash April 1, 2020 17:40
gspread/utils.py Outdated Show resolved Hide resolved
@burnash burnash modified the milestones: 3.4.0, 3.5.0 Apr 5, 2020
gspread/models.py Outdated Show resolved Hide resolved
@chrischansonichu chrischansonichu requested a review from burnash April 9, 2020 13:29
@burnash burnash merged commit dc70dd9 into burnash:master Apr 10, 2020
@burnash
Copy link
Owner

burnash commented Apr 10, 2020

Works well. Thank you very much! Kudos for expanding the docstring for numericise_all()

@mmsbr
Copy link

mmsbr commented May 9, 2020

Hello friends! How can I use this fix in my code? I'm using gspread for python3 and I really need the leading zeros and get_all_records() is removing it

@mmsbr
Copy link

mmsbr commented May 9, 2020

Just to answer my own question and to help others that may have the same problem. Now you can keep leading zeros just using get_all_records() like this: get_all_records(numericise_ignore=['all']) and gspread won't convert your strings! Thank so much for this @benjamindhimes !!! You are awesome!

@Ehayanarle
Copy link

@mmsbr I was looking for the solving of a problem for a couple of days but it was so easy. I should read the fu***** documentation and code of the module. Thank you very much for the solution!

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