-
Notifications
You must be signed in to change notification settings - Fork 132
Closed
martinitus/databricks-sql-python
#1Description
While PEP249 says
Modules are free to implement this method using multiple calls to the .execute() method or by using array operations to have the database process the sequence as a whole in one call.
Just reading the docstring from the connection class is maximally misleading:
databricks-sql-python/src/databricks/sql/client.py
Lines 527 to 538 in 7aaa014
| def executemany(self, operation, seq_of_parameters): | |
| """ | |
| Prepare a database operation (query or command) and then execute it against all parameter | |
| sequences or mappings found in the sequence ``seq_of_parameters``. | |
| Only the final result set is retained. | |
| :returns self | |
| """ | |
| for parameters in seq_of_parameters: | |
| self.execute(operation, parameters) | |
| return self |
As a user, I (of course) assumed that databricks-sql-connector does something smart like e.g. batched inserts for a insert query. Instead I find that I have many thousand sequentially executed individual insert requests, one for each row.
I suggest to change the docstring to point out that behaviour!
Metadata
Metadata
Assignees
Labels
No labels