Skip to content

Commit 51fdc1e

Browse files
committed
Allow deprecated methods for dict_id
1 parent d51ba47 commit 51fdc1e

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

datafusion/physical-plan/src/aggregates/mod.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,25 +2436,21 @@ mod tests {
24362436
"labels".to_string(),
24372437
DataType::Struct(
24382438
vec![
2439-
Field::new_dict(
2439+
Field::new(
24402440
"a".to_string(),
24412441
DataType::Dictionary(
24422442
Box::new(DataType::Int32),
24432443
Box::new(DataType::Utf8),
24442444
),
24452445
true,
2446-
0,
2447-
false,
24482446
),
2449-
Field::new_dict(
2447+
Field::new(
24502448
"b".to_string(),
24512449
DataType::Dictionary(
24522450
Box::new(DataType::Int32),
24532451
Box::new(DataType::Utf8),
24542452
),
24552453
true,
2456-
0,
2457-
false,
24582454
),
24592455
]
24602456
.into(),
@@ -2466,15 +2462,13 @@ mod tests {
24662462
vec![
24672463
Arc::new(StructArray::from(vec![
24682464
(
2469-
Arc::new(Field::new_dict(
2465+
Arc::new(Field::new(
24702466
"a".to_string(),
24712467
DataType::Dictionary(
24722468
Box::new(DataType::Int32),
24732469
Box::new(DataType::Utf8),
24742470
),
24752471
true,
2476-
0,
2477-
false,
24782472
)),
24792473
Arc::new(
24802474
vec![Some("a"), None, Some("a")]
@@ -2483,15 +2477,13 @@ mod tests {
24832477
) as ArrayRef,
24842478
),
24852479
(
2486-
Arc::new(Field::new_dict(
2480+
Arc::new(Field::new(
24872481
"b".to_string(),
24882482
DataType::Dictionary(
24892483
Box::new(DataType::Int32),
24902484
Box::new(DataType::Utf8),
24912485
),
24922486
true,
2493-
0,
2494-
false,
24952487
)),
24962488
Arc::new(
24972489
vec![Some("b"), Some("c"), Some("b")]

datafusion/proto-common/src/from_proto/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ impl TryFrom<&protobuf::Field> for Field {
321321
fn try_from(field: &protobuf::Field) -> Result<Self, Self::Error> {
322322
let datatype = field.arrow_type.as_deref().required("arrow_type")?;
323323
let field = if field.dict_id != 0 {
324+
// TODO file a ticket about handling deprecated dict_id attributes
325+
#[allow(deprecated)]
324326
Self::new_dict(
325327
field.name.as_str(),
326328
datatype,
@@ -365,6 +367,8 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue {
365367
.as_ref()
366368
.ok_or_else(|| Error::required("value"))?;
367369

370+
// TODO file a ticket about handling deprecated dict_id attributes
371+
#[allow(deprecated)]
368372
Ok(match value {
369373
Value::BoolValue(v) => Self::Boolean(Some(*v)),
370374
Value::Utf8Value(v) => Self::Utf8(Some(v.to_owned())),

datafusion/proto-common/src/to_proto/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ impl TryFrom<&Field> for protobuf::Field {
9797
nullable: field.is_nullable(),
9898
children: Vec::new(),
9999
metadata: field.metadata().clone(),
100+
// TODO file a ticket about handling deprecated dict_id attributes
101+
#[allow(deprecated)]
100102
dict_id: field.dict_id().unwrap_or(0),
101103
dict_ordered: field.dict_is_ordered().unwrap_or(false),
102104
})

datafusion/proto/tests/cases/roundtrip_logical_plan.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,8 @@ fn round_trip_datatype() {
17771777
}
17781778
}
17791779

1780+
// TODO file a ticket about handling deprecated dict_id attributes
1781+
#[allow(deprecated)]
17801782
#[test]
17811783
fn roundtrip_dict_id() -> Result<()> {
17821784
let dict_id = 42;

0 commit comments

Comments
 (0)