Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed Guide
  • Loading branch information
zaleslaw committed Aug 29, 2025
commit e072bfe3ee486a66074a2f014880e34fbee82c5f
16 changes: 8 additions & 8 deletions dataframe-spring/INTEGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ dependencies {
class AppConfiguration
```

### 3. Use @DataSource Annotation
### 3. Use @CsvDataSource Annotation

```kotlin
@Component
class CustomerService {
@DataSource(csvFile = "customers.csv")
@CsvDataSource(file = "customers.csv")
lateinit var customers: DataFrame<CustomerRow>

@DataSource(csvFile = "orders.csv", delimiter = ';')
@CsvDataSource(file = "orders.csv", delimiter = ';')
lateinit var orders: DataFrame<OrderRow>

fun analyzeCustomers() {
Expand Down Expand Up @@ -70,21 +70,21 @@ class DataFrameConfig {
Use Spring's property placeholders:

```kotlin
@DataSource(csvFile = "\${app.data.customers.file}")
@CsvDataSource(file = "${app.data.customers.file}")
lateinit var customers: DataFrame<CustomerRow>
```

### Error Handling

The post-processor provides detailed error messages:

```kotlin
```
// File not found
RuntimeException: Failed to process @DataSource annotations for bean 'customerService'
RuntimeException: Failed to process @CsvDataSource annotations for bean 'customerService'
Caused by: IllegalArgumentException: CSV file not found: /path/to/customers.csv

// Wrong property type
IllegalArgumentException: Property 'data' is annotated with @DataSource but is not a DataFrame type
IllegalArgumentException: Property 'data' is annotated with @CsvDataSource but is not a DataFrame type

// CSV parsing error
RuntimeException: Failed to read CSV file 'customers.csv' for property 'customers'
Expand Down Expand Up @@ -138,4 +138,4 @@ class DataFrameServiceTest {
assertTrue(customerService.customers.rowsCount() > 0)
}
}
```
```