Comments (5)
Do you need the api response captured at runtime, or do you just need to see the response json as a log message? Because the response json is logged to the logger named gspread_dataframe
at level DEBUG
; set the logging level to DEBUG for the logger name or all loggers, and you will see the response json in the log output.
If you want the api response returned at runtime, tell me more about why you'd want it, and we can consider whether to change set_with_dataframe to return the api response object...
from gspread-dataframe.
@franciscothebrady An example debug log message from set_with_dataframe
shows what the API response json would contain:
{
'spreadsheetId': '1P3rdCCxfO760TJdE-cbi0k_yy9vmC-joapjuGw9vNjc',
'updatedRange': 'wksht_int_test!A1:T20',
'updatedRows': 20,
'updatedColumns': 20,
'updatedCells': 400
}
If you just want to see this in your logs, enable logging at level DEBUG either throughout your program or for the logger logging.getLogger('gspread_dataframe')
and all of its relevant handlers. (Configuring DEBUG-level logging in Python can be tricky; let me know if I can help.)
But if you really need the API response to be returned by set_with_dataframe
so that you have it at runtime, please, tell me more.
from gspread-dataframe.
I literally just finished adding a logfile and some setup for this. I appreciate the added context and info about the logging.getLogger()
. I'm running now and will update with results.
The context here is that I'm running this weekly to update some data for dashboards, and I want confirmation that the dataframe being pushed to gdrive is complete. These aren't huge sheets (2 - <10k rows), so I shouldn't be running up against any limits, but last week we had some odd results and it looks like one sheet wasn't completely updated. It sounds like if the full API response is returned that will confirm at least updatedRows
, which might be enough. Thanks for you help.
from gspread-dataframe.
In my experience, the Sheets API is well-behaved around updates and error reporting. Either your cell updates to a worksheet succeed completely, or the API responds with a 4xx or 5xx status code and your Python API client raises an exception. If you are seeing "incomplete updates" to a worksheet without an exception raised by set_with_dataframe
, I would be shocked if the cause lies somewhere in gspread_dataframe
or the Sheets API.
Let me know how this resolves for you; I'll keep the issue open in the meantime.
from gspread-dataframe.
I think the log file is showing everything I needed. 200's all the way through. I'm leaning toward this being a further upstream issue, but I think I do need to build in some kind of exception handling if the API response isn't 200. I'm not a python expert yet. I think closing this issue for now is fine.
from gspread-dataframe.
Related Issues (20)
- Bug: escaping when allow_formulas = False is not returning any value HOT 1
- set_with_dataframe: TypeError: Object of type 'int64' is not JSON serializable HOT 2
- Sheets API erroneously rejects new rowCount if (new rowCount * old columnCount) > 5000000 (was: Bug in the number of cells of the dataframe HOT 4
- Cannot use gspread's add_row() method before using set_with_dataframe() HOT 8
- Can't import, "No module named gspread.models" HOT 1
- Consider allowing option to drop duplicates in set_with_dataframe HOT 4
- Data gets interpreted even when using dtype=str HOT 1
- ModuleNotFoundError: No module named 'gspread.models' HOT 7
- Write header rows for DataFrames with MultiIndex columns so that Pandas reads them properly HOT 1
- Include formatting options in set_with_dataframe
- Consider offering a reader/writer object based on a given dataframe
- No module named 'gspread' HOT 2
- Feature Request: Append feature to an existing sheet. HOT 1
- Max Cell Count
- Requests to sheets API cause 400 error is worksheet name is valid cell reference (was: Error using get_as_dataframe) HOT 1
- Newest version gspread not compatible HOT 7
- get_as_dataframe() is reading the whole sheet data HOT 2
- Advice to update just one column of a DataFrame in a worksheet (was: ValueError when trying to set a single column) HOT 2
- Support drop_empty_rows and drop_empty_columns, default True (was: get dataframe does not work with non-programatically created sheets) HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gspread-dataframe.