fix: resolve time crate compile error under source-azure feature#23
Merged
bashandbone merged 2 commits intomainfrom Mar 4, 2026
Merged
fix: resolve time crate compile error under source-azure feature#23bashandbone merged 2 commits intomainfrom
time crate compile error under source-azure feature#23bashandbone merged 2 commits intomainfrom
Conversation
Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix cause of recent CI test failure in source-azure
fix: resolve Mar 4, 2026
time crate compile error under source-azure feature
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a --features source-azure build failure in recoco-core by removing a direct dependency on the time crate from the Azure Blob source implementation and instead using the azure_core re-export already enabled by source-azure.
Changes:
- Switch
datetime_to_ordinalto acceptazure_core::time::OffsetDateTimeinstead oftime::OffsetDateTime.
Comments suppressed due to low confidence (1)
crates/recoco-core/src/ops/sources/azure_blob.rs:53
dt.unix_timestamp_nanos()is (effectively) an i128 nanosecond count; casting toi64before dividing can truncate/overflow for out-of-range timestamps. To avoid incorrect ordinals, do the division in the wider type first (or use a checked conversion) and only then cast toi64(similar toamazon_s3.rs’s(as_nanos() / 1000) as i64).
fn datetime_to_ordinal(dt: &azure_core::time::OffsetDateTime) -> Ordinal {
Ordinal(Some(dt.unix_timestamp_nanos() as i64 / 1000))
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
azure_blob.rsreferencedtime::OffsetDateTimedirectly, but thetimecrate is only gated behindprovider-azure— notsource-azure. Building with--features source-azurealone produced:Change
azure_blob.rs: Replace baretime::OffsetDateTimewithazure_core::time::OffsetDateTime, which re-exports the same type via theazure_coredep already required bysource-azure.No feature definitions or new dependencies required.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.