You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "paulk-asert (via GitHub)" <gi...@apache.org> on 2026/05/15 03:49:18 UTC
[PR] GROOVY-12011: groovy-csv: clarify when dates can retain rich types vs… [groovy]
paulk-asert opened a new pull request, #2534:
URL: https://github.com/apache/groovy/pull/2534
… when handled as Strings
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12011: groovy-csv: clarify when dates can retain rich types vs… [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2534:
URL: https://github.com/apache/groovy/pull/2534#issuecomment-4456934170
## ✅ All tests passed ✅
🏷️ Commit: 26abfcaef322de963e35b6567a7c1912a2e67404
▶️ Tests: 81193 executed
⚪️ Checks: 28/28 completed
---
_Learn more about TestLens at [testlens.app](https://testlens.app)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12011: groovy-csv: clarify when dates can retain rich types vs… [groovy]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2534:
URL: https://github.com/apache/groovy/pull/2534#issuecomment-4456872615
## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2534?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 68.1426%. Comparing base ([`94ae84d`](https://app.codecov.io/gh/apache/groovy/commit/94ae84d3fa788065b04d6d423e9551f6d35c8b8b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`26abfca`](https://app.codecov.io/gh/apache/groovy/commit/26abfcaef322de963e35b6567a7c1912a2e67404?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/2534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2534 +/- ##
==================================================
- Coverage 68.1437% 68.1426% -0.0011%
+ Complexity 32755 32754 -1
==================================================
Files 1499 1499
Lines 125228 125233 +5
Branches 22604 22604
==================================================
+ Hits 85335 85337 +2
- Misses 32381 32383 +2
- Partials 7512 7513 +1
```
| [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2534?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...roovy-csv/src/main/java/groovy/csv/CsvBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/2534?src=pr&el=tree&filepath=subprojects%2Fgroovy-csv%2Fsrc%2Fmain%2Fjava%2Fgroovy%2Fcsv%2FCsvBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWNzdi9zcmMvbWFpbi9qYXZhL2dyb292eS9jc3YvQ3N2QnVpbGRlci5qYXZh) | `65.2174% <100.0000%> (ø)` | |
| [...roovy-csv/src/main/java/groovy/csv/CsvSlurper.java](https://app.codecov.io/gh/apache/groovy/pull/2534?src=pr&el=tree&filepath=subprojects%2Fgroovy-csv%2Fsrc%2Fmain%2Fjava%2Fgroovy%2Fcsv%2FCsvSlurper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWNzdi9zcmMvbWFpbi9qYXZhL2dyb292eS9jc3YvQ3N2U2x1cnBlci5qYXZh) | `66.6667% <100.0000%> (+3.0303%)` | :arrow_up: |
... and [5 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2534/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12011: groovy-csv: clarify when dates can retain rich types vs… [groovy]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #2534:
URL: https://github.com/apache/groovy/pull/2534#discussion_r3245949375
##########
subprojects/groovy-csv/src/main/java/groovy/csv/CsvSlurper.java:
##########
@@ -58,7 +61,15 @@ public class CsvSlurper {
* and treats the first row as headers.
*/
public CsvSlurper() {
- this.mapper = new CsvMapper();
+ this.mapper = mapper();
+ }
+
+ static CsvMapper mapper() {
+ return CsvMapper.builder()
+ .addModule(new JavaTimeModule())
+ .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
Review Comment:
This mapper still leaves Jackson's `SerializationFeature.WRITE_DATES_WITH_CONTEXT_TIME_ZONE` at its default, so `OffsetDateTime`/zoned values can be normalized to the mapper context time zone during `CsvBuilder.toCsv` before `parseAs` reads them back. That contradicts the documented `OffsetDateTime` fidelity for non-UTC offsets; disable the serialization-side context time-zone adjustment as well or narrow the documented support.
##########
subprojects/groovy-csv/build.gradle:
##########
@@ -24,6 +24,7 @@ dependencies {
api rootProject
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:${versions.jackson}"
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
+ implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}"
Review Comment:
Adding this new external artifact also needs an entry in `gradle/verification-metadata.xml`. The repository has Gradle dependency verification enabled and its metadata currently has no `jackson-datatype-jsr310` component, so builds that resolve `groovy-csv` will fail verification until the metadata is updated.
##########
subprojects/groovy-csv/src/spec/doc/csv-userguide.adoc:
##########
@@ -78,6 +78,15 @@ include::../test/groovy/csv/CsvSlurperTest.groovy[tags=typed_parsing,indent=0]
include::../test/groovy/csv/CsvSlurperTest.groovy[tags=typed_parsing_usage,indent=0]
----
+[NOTE]
+====
+CSV has no native types — every cell is text, so the untyped `parse`/`parseText`
+API always returns `String` values, including for date/time-looking columns. Use
+the typed `parseAs` API with `java.time.*` fields (see <<csv_typed_temporal>>) for
+`java.time.LocalDate`, `java.time.LocalTime`, `java.time.LocalDateTime`, and
+`java.time.OffsetDateTime` fidelity.
Review Comment:
The guide promises `OffsetDateTime` fidelity, but the current mapper configuration still allows serialization through the context time zone, which can change the original offset before parsing. Either adjust the mapper to preserve offsets or avoid documenting `OffsetDateTime` as fully faithful.
##########
subprojects/groovy-csv/src/spec/test/groovy/csv/CsvBuilderTest.groovy:
##########
@@ -106,4 +106,45 @@ class CsvBuilderTest {
assert parsed[0].name == 'Widget'
assert parsed[0].price == 9.99
}
+
+ // tag::temporal_class[]
+ static class Event {
+ java.time.LocalDate day
+ java.time.LocalTime windowStart
+ String label
Review Comment:
The temporal round-trip test only exercises `LocalDate` and `LocalTime`, while the new guide explicitly documents `LocalDateTime` and `OffsetDateTime` fidelity and the mapper changes include timezone-sensitive configuration. Please add coverage for at least `LocalDateTime` and a non-UTC `OffsetDateTime` so the documented behavior is protected.
##########
subprojects/groovy-csv/build.gradle:
##########
@@ -24,6 +24,7 @@ dependencies {
api rootProject
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:${versions.jackson}"
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
Review Comment:
This adds a new runtime dependency. Repository guidance requires new runtime dependencies to have the dev@ discussion flagged and a NOTICE/LICENSE impact review, with any required updates included in the same change (see AGENTS.md:90-91 and .agents/skills/groovy-build/SKILL.md:248-250). Please add that evidence or the required notice/license updates.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12011: groovy-csv: clarify when dates can retain rich types vs… [groovy]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2534:
URL: https://github.com/apache/groovy/pull/2534#issuecomment-4457555935
## [](https://sonarcloud.io/dashboard?id=apache_groovy&pullRequest=2534) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_groovy&pullRequest=2534&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_groovy&pullRequest=2534&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_groovy&pullRequest=2534&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_groovy&pullRequest=2534&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_groovy&pullRequest=2534&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_groovy&pullRequest=2534)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12011: groovy-csv: clarify when dates can retain rich types vs… [groovy]
Posted by "paulk-asert (via GitHub)" <gi...@apache.org>.
paulk-asert merged PR #2534:
URL: https://github.com/apache/groovy/pull/2534
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org