Repository: duckdb/duckdb (language: python)

Issue:
Misleading error message appender - not all columns appended
### What happens?

When using the appender (https://duckdb.org/docs/api/c/appender) and when appending an _insufficient_ number of columns, an error is raised.

The text of the error message thrown
```
InvalidInputException("Call to EndRow before all rows have been appended to!");
```
appears to be misleading, though, as it talks about rows, when columns are missing. It may be preferable to have
```
InvalidInputException("Call to EndRow before all columns have been appended to!");
```
or even
```
InvalidInputException("Call to EndRow before all columns of the row have been appended!");
```

For reference, see https://github.com/duckdb/duckdb-java/blob/966fb56335a931b651901eb30e6fb38e32f21f73/src/duckdb/src/main/appender.cpp#L114

### To Reproduce

Run an appender which does not append enough columns.

### OS:

Arch Linux x86_64

### DuckDB Version:

1.1.0

### DuckDB Client:

C / Java

### Hardware:

_No response_

### Full Name:

Stefan Hoffmeister

### Affiliation:

none

### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

### Did you include all relevant data sets for reproducing the issue?

Yes

### Did you include all code required to reproduce the issue?

- [X] Yes, I have

### Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

- [X] Yes, I have


Discussion / hints:

Fix patch:
diff --git a/src/main/appender.cpp b/src/main/appender.cpp
index 564fff2e923d..ae3608524149 100644
--- a/src/main/appender.cpp
+++ b/src/main/appender.cpp
@@ -114,7 +114,7 @@ void BaseAppender::BeginRow() {
 void BaseAppender::EndRow() {
 	// check that all rows have been appended to
 	if (column != chunk.ColumnCount()) {
-		throw InvalidInputException("Call to EndRow before all rows have been appended to!");
+		throw InvalidInputException("Call to EndRow before all columns have been appended to!");
 	}
 	column = 0;
 	chunk.SetCardinality(chunk.size() + 1);


Test patch:
diff --git a/test/api/capi/test_capi_appender.cpp b/test/api/capi/test_capi_appender.cpp
index f48b68baad86..2c232b5e4807 100644
--- a/test/api/capi/test_capi_appender.cpp
+++ b/test/api/capi/test_capi_appender.cpp
@@ -245,7 +245,7 @@ TEST_CASE("Test appender statements in C API", "[capi]") {
 	// Missing column.
 	REQUIRE(duckdb_appender_end_row(appender) == DuckDBError);
 	REQUIRE(duckdb_appender_error(appender) != nullptr);
-	TestAppenderError(appender, "Call to EndRow before all rows have been appended to");
+	TestAppenderError(appender, "Call to EndRow before all columns have been appended to");
 
 	// Append the missing column.
 	REQUIRE(duckdb_append_varchar(appender, "Hello, World") == DuckDBSuccess);