• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

getdozer / dozer / 5672512448

pending completion
5672512448

push

github

web-flow
chore: Change `make_from!` in `from_arrow` to func to improve readability (#1792)

31 of 31 new or added lines in 4 files covered. (100.0%)

45630 of 59777 relevant lines covered (76.33%)

38810.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.71
/dozer-sql/src/pipeline/table_operator/tests/operator_test.rs
1
use std::time::Duration;
2

3
use dozer_core::processor_record::{ProcessorRecord, ProcessorRecordRef};
4
use dozer_types::{
5
    chrono::DateTime,
6
    types::{Field, FieldDefinition, FieldType, Lifetime, Schema, SourceDefinition},
7
};
8

9
use crate::pipeline::{
10
    expression::execution::Expression,
11
    table_operator::{lifetime::LifetimeTableOperator, operator::TableOperator},
12
};
13

14
#[test]
1✔
15
fn test_lifetime() {
1✔
16
    let schema = Schema::default()
1✔
17
        .field(
1✔
18
            FieldDefinition::new(
1✔
19
                "id".to_string(),
1✔
20
                FieldType::Int,
1✔
21
                false,
1✔
22
                SourceDefinition::Alias {
1✔
23
                    name: "alias".to_string(),
1✔
24
                },
1✔
25
            ),
1✔
26
            false,
1✔
27
        )
1✔
28
        .field(
1✔
29
            FieldDefinition::new(
1✔
30
                "ref".to_string(),
1✔
31
                FieldType::Timestamp,
1✔
32
                false,
1✔
33
                SourceDefinition::Alias {
1✔
34
                    name: "alias".to_string(),
1✔
35
                },
1✔
36
            ),
1✔
37
            false,
1✔
38
        )
1✔
39
        .to_owned();
1✔
40

1✔
41
    let mut record = ProcessorRecord::new();
1✔
42
    record.extend_direct_field(Field::Int(0));
1✔
43
    record.extend_direct_field(Field::Timestamp(
1✔
44
        DateTime::parse_from_rfc3339("2020-01-01T00:13:00Z").unwrap(),
1✔
45
    ));
1✔
46
    let record = ProcessorRecordRef::new(record);
1✔
47

1✔
48
    let table_operator = LifetimeTableOperator::new(
1✔
49
        None,
1✔
50
        Expression::Column { index: 1 },
1✔
51
        // Expression::new(
1✔
52
        //     ExpressionType::BinaryExpression {
1✔
53
        //         operator: BinaryOperator::Add,
1✔
54
        //         left: Box::new(Expression::new(ExpressionType::Field("ref".to_string()))),
1✔
55
        //         right: Box::new(Expression::new(ExpressionType::Literal(
1✔
56
        //             Literal::Duration(DozerDuration(
1✔
57
        //                 Duration::from_secs(60),
1✔
58
        //                 TimeUnit::Seconds,
1✔
59
        //             )),
1✔
60
        //         ))),
1✔
61
        //     },
1✔
62
        //     "ref".to_string(),
1✔
63
        // ),
1✔
64
        Duration::from_secs(60),
1✔
65
    );
1✔
66

1✔
67
    let result = table_operator.execute(&record, &schema).unwrap();
1✔
68
    assert_eq!(result.len(), 1);
1✔
69
    let lifetime_record = result.get(0).unwrap();
1✔
70

1✔
71
    let mut expected_record = ProcessorRecord::new();
1✔
72
    expected_record.extend_referenced_record(record);
1✔
73

1✔
74
    expected_record.set_lifetime(Some(Lifetime {
1✔
75
        reference: DateTime::parse_from_rfc3339("2020-01-01T00:13:00Z").unwrap(),
1✔
76
        duration: Duration::from_secs(60),
1✔
77
    }));
1✔
78

1✔
79
    assert_eq!(*lifetime_record, ProcessorRecordRef::new(expected_record));
1✔
80
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc