Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforcing kotlinx datetime bias #843

Merged
merged 2 commits into from
Sep 3, 2024
Merged

Enforcing kotlinx datetime bias #843

merged 2 commits into from
Sep 3, 2024

Conversation

Jolanrensen
Copy link
Collaborator

Different parts of the library had different biases towards using Java's datetime libraries or Kotlin's.

Since DF is a Kotlin library, we should prefer Kotlin's.

This PR addresses that, while also filling in some missing conversions/parsers.

@Jolanrensen Jolanrensen added bug Something isn't working enhancement New feature or request labels Aug 27, 2024
@Jolanrensen Jolanrensen added this to the 0.14.0 milestone Aug 27, 2024
@Jolanrensen Jolanrensen marked this pull request as ready for review August 27, 2024 12:36
@Jolanrensen Jolanrensen self-assigned this Aug 28, 2024
}

java.time.LocalDate::class -> convert<Long> { it.toLocalDate(defaultTimeZone).toJavaLocalDate() }
JavaLocalDate::class -> convert<Int> { it.toLong().toLocalDate(defaultTimeZone).toJavaLocalDate() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears like Long converter was removed. Why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the when (fromClass) { Int::class -> } branch, not the Long branch :) it was in the wrong place

@@ -243,29 +243,30 @@ internal class ArrowWriterImpl(
is TimeNanoVector ->
column.convertToLocalTime()
.forEachIndexed { i, value ->
value?.also { vector.set(i, value.toNanoOfDay()) }
value?.also { vector.set(i, value.toJavaLocalTime().toNanoOfDay()) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this conversion needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, it isn't :) thanks

@koperagen
Copy link
Collaborator

I wouldn't assign "bug" to this. Instead, something like "migration-needed" would be good. For user it will be a breaking change

@Jolanrensen Jolanrensen removed the bug Something isn't working label Sep 2, 2024
Copy link
Contributor

github-actions bot commented Sep 2, 2024

Generated sources will be updated after merging this PR.
Please inspect the changes in here.

@Jolanrensen Jolanrensen merged commit 7161aae into master Sep 3, 2024
5 checks passed
@Jolanrensen Jolanrensen deleted the kotlinx.datetime branch September 3, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants