Skip to content
Draft
Show file tree
Hide file tree
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 some bugs
  • Loading branch information
zaleslaw committed Aug 29, 2025
commit 2dc29531abc4a785eb7a64eaedea8785f3f61d06
19 changes: 3 additions & 16 deletions dataframe-spring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Inspired by Spring Data's approach to data source management, this integration s
- **@JsonDataSource** - JSON files with type clash handling and key-value processing
- **@ArrowDataSource** - Arrow/Parquet/Feather files with format auto-detection
- **@JdbcDataSource** - Database tables and custom queries with connection pooling
- **@DataSource** - Legacy CSV support (deprecated, use @CsvDataSource)

### Spring Data Inspiration
- **Declarative Configuration**: Data sources specified through annotations
Expand Down Expand Up @@ -79,6 +78,8 @@ class DataFrameConfiguration {
}
}
}
```

## 📖 Data Source Types

### CSV Data Sources
Expand Down Expand Up @@ -318,20 +319,6 @@ class DataService {
}
```

### From Legacy @DataSource

**Before:**
```kotlin
@DataSource(csvFile = "data.csv", delimiter = ',')
lateinit var data: DataFrame<*>
```

**After:**
```kotlin
@CsvDataSource(file = "data.csv", delimiter = ',')
lateinit var data: DataFrame<*>
```

## 🐛 Troubleshooting

### Common Issues
Expand Down Expand Up @@ -371,4 +358,4 @@ logging.level.org.jetbrains.kotlinx.dataframe.spring=DEBUG

This module demonstrates the power of combining Spring's dependency injection with DataFrame's unified data processing API. The Spring Data-inspired approach provides a consistent, declarative way to handle multiple data sources while maintaining the flexibility and power of the DataFrame API.

For more examples and advanced usage patterns, see the `examples/` directory in the module.
For more examples and advanced usage patterns, see the `examples/` directory in the module.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.jetbrains.kotlinx.dataframe.api.NullabilityOptions
* @param format The file format to use (AUTO, IPC, FEATHER)
* @param nullability How to handle nullable types (default: Infer)
*
* @see DataFramePostProcessor
* @see org.jetbrains.kotlinx.dataframe.spring.DataFramePostProcessor
*/
@Target(AnnotationTarget.FIELD, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.RUNTIME)
Expand All @@ -39,4 +39,4 @@ enum class ArrowFormat {
* Arrow Feather format (.feather)
*/
FEATHER
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package org.jetbrains.kotlinx.dataframe.spring.annotations
* Annotation to mark DataFrame fields/properties that should be automatically
* populated with data from a CSV file using Spring's dependency injection.
*
* This annotation is processed by [DataFramePostProcessor] during Spring
* This annotation is processed by [org.jetbrains.kotlinx.dataframe.spring.DataFramePostProcessor] during Spring
* bean initialization.
*
* @param file The path to the CSV file to read from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package org.jetbrains.kotlinx.dataframe.spring.annotations
* Annotation to mark DataFrame fields/properties that should be automatically
* populated with data from a JDBC database using Spring's dependency injection.
*
* This annotation is processed by [DataFramePostProcessor] during Spring
* This annotation is processed by [org.jetbrains.kotlinx.dataframe.spring.DataFramePostProcessor] during Spring
* bean initialization.
*
* @param url The JDBC URL to connect to (if not using existing connection)
Expand All @@ -15,7 +15,7 @@ package org.jetbrains.kotlinx.dataframe.spring.annotations
* @param username Database username (if not using connectionBean)
* @param password Database password (if not using connectionBean)
*
* @see DataFramePostProcessor
* @see org.jetbrains.kotlinx.dataframe.spring.DataFramePostProcessor
*/
@Target(AnnotationTarget.FIELD, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.RUNTIME)
Expand All @@ -28,4 +28,4 @@ annotation class JdbcDataSource(
val limit: Int = -1,
val username: String = "",
val password: String = ""
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import org.jetbrains.kotlinx.dataframe.io.JSON
* Annotation to mark DataFrame fields/properties that should be automatically
* populated with data from a JSON file using Spring's dependency injection.
*
* This annotation is processed by [DataFramePostProcessor] during Spring
* This annotation is processed by [org.jetbrains.kotlinx.dataframe.spring.DataFramePostProcessor] during Spring
* bean initialization.
*
* @param file The path to the JSON file to read from
* @param keyValuePaths List of JSON paths for key-value pair processing (comma-separated)
* @param typeClashTactic How to handle type clashes when reading JSON (default: ARRAY_AND_VALUE_COLUMNS)
* @param unifyNumbers Whether to unify numeric types (default: true)
*
* @see DataFramePostProcessor
* @see org.jetbrains.kotlinx.dataframe.spring.DataFramePostProcessor
*/
@Target(AnnotationTarget.FIELD, AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.RUNTIME)
Expand Down