Skip to content

fix: resolve time crate compile error under source-azure feature#23

Merged
bashandbone merged 2 commits intomainfrom
copilot/fix-ci-test-failure-source-azure
Mar 4, 2026
Merged

fix: resolve time crate compile error under source-azure feature#23
bashandbone merged 2 commits intomainfrom
copilot/fix-ci-test-failure-source-azure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 4, 2026

azure_blob.rs referenced time::OffsetDateTime directly, but the time crate is only gated behind provider-azure — not source-azure. Building with --features source-azure alone produced:

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `time`
  --> crates/recoco-core/src/ops/sources/azure_blob.rs:51:29

Change

  • azure_blob.rs: Replace bare time::OffsetDateTime with azure_core::time::OffsetDateTime, which re-exports the same type via the azure_core dep already required by source-azure.
// before
fn datetime_to_ordinal(dt: &time::OffsetDateTime) -> Ordinal {

// after
fn datetime_to_ordinal(dt: &azure_core::time::OffsetDateTime) -> Ordinal {

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.

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 time crate compile error under source-azure feature Mar 4, 2026
@bashandbone bashandbone marked this pull request as ready for review March 4, 2026 18:52
Copilot AI review requested due to automatic review settings March 4, 2026 18:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_ordinal to accept azure_core::time::OffsetDateTime instead of time::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 to i64 before 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 to i64 (similar to amazon_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.

@bashandbone bashandbone merged commit 2f1503e into main Mar 4, 2026
40 of 41 checks passed
@bashandbone bashandbone deleted the copilot/fix-ci-test-failure-source-azure branch March 4, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants