From 2672cb58a7e2c0c4281c4d47e01286e05b8cc95a Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 6 Jul 2023 12:52:27 +0200 Subject: [PATCH 1/4] introduce 'is_nullable' semantic attribute --- .../re_types/definitions/fbs/attributes.fbs | 8 + crates/re_types/source_hash.txt | 2 +- crates/re_types/src/archetypes/fuzzy.rs | 2018 ++++++++--------- crates/re_types/src/archetypes/points2d.rs | 479 ++-- crates/re_types/src/components/fuzzy.rs | 298 +-- crates/re_types/src/datatypes/fuzzy.rs | 165 +- crates/re_types_builder/src/lib.rs | 1 + crates/re_types_builder/src/objects.rs | 12 +- .../rerun/_rerun2/archetypes/fuzzy.py | 130 +- .../rerun/_rerun2/archetypes/points2d.py | 35 +- .../rerun/_rerun2/components/fuzzy.py | 32 +- .../rerun/_rerun2/datatypes/fuzzy.py | 30 +- 12 files changed, 1517 insertions(+), 1693 deletions(-) diff --git a/crates/re_types/definitions/fbs/attributes.fbs b/crates/re_types/definitions/fbs/attributes.fbs index d8b50532e3d5..97c46946ab9e 100644 --- a/crates/re_types/definitions/fbs/attributes.fbs +++ b/crates/re_types/definitions/fbs/attributes.fbs @@ -30,3 +30,11 @@ attribute "order"; /// table when defining a union, cannot put arrays (as opposed to vectors) into tables, etc) that /// do not apply in our case. attribute "transparent"; + +/// If specified on a field, the field becomes nullable, which affects both its native as well as +/// its arrow datatypes. +/// +/// NOTE: We do not use flatbuffers' builtin `required` attribute because A) it has many +/// limitations that do not make sense for our use case and B) our overall data model is built +/// around the idea of nullability, rather than requirements (i.e. the exact opposite). +attribute "is_nullable"; diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index 28285ddc57a4..da0ae72b7c4d 100644 --- a/crates/re_types/source_hash.txt +++ b/crates/re_types/source_hash.txt @@ -1,4 +1,4 @@ # This is a sha256 hash for all direct and indirect dependencies of this crate's build script. # It can be safely removed at anytime to force the build script to run again. # Check out build.rs to see how it's computed. -7dfe285eaa19872ddde875b16aa511da2b0e1f9fbeed723fa7a86920a2cc1738 \ No newline at end of file +b082d754a07a09876359fde690a979681127e0ea911d213c4aaaa70aa47f4f2b \ No newline at end of file diff --git a/crates/re_types/src/archetypes/fuzzy.rs b/crates/re_types/src/archetypes/fuzzy.rs index 22609bed9f1b..29b9f74041a3 100644 --- a/crates/re_types/src/archetypes/fuzzy.rs +++ b/crates/re_types/src/archetypes/fuzzy.rs @@ -37,32 +37,32 @@ pub struct AffixFuzzer1 { pub fuzz1111: Vec, pub fuzz1112: Vec, pub fuzz1113: Vec, - pub fuzz2001: Option, - pub fuzz2002: Option, - pub fuzz2003: Option, - pub fuzz2004: Option, - pub fuzz2005: Option, - pub fuzz2006: Option, - pub fuzz2007: Option, - pub fuzz2008: Option, - pub fuzz2009: Option, - pub fuzz2010: Option, - pub fuzz2011: Option, - pub fuzz2012: Option, - pub fuzz2013: Option, - pub fuzz2101: Option>, - pub fuzz2102: Option>, - pub fuzz2103: Option>, - pub fuzz2104: Option>, - pub fuzz2105: Option>, - pub fuzz2106: Option>, - pub fuzz2107: Option>, - pub fuzz2108: Option>, - pub fuzz2109: Option>, - pub fuzz2110: Option>, - pub fuzz2111: Option>, - pub fuzz2112: Option>, - pub fuzz2113: Option>, + pub fuzz2001: crate::components::AffixFuzzer1, + pub fuzz2002: crate::components::AffixFuzzer2, + pub fuzz2003: crate::components::AffixFuzzer3, + pub fuzz2004: crate::components::AffixFuzzer4, + pub fuzz2005: crate::components::AffixFuzzer5, + pub fuzz2006: crate::components::AffixFuzzer6, + pub fuzz2007: crate::components::AffixFuzzer7, + pub fuzz2008: crate::components::AffixFuzzer8, + pub fuzz2009: crate::components::AffixFuzzer9, + pub fuzz2010: crate::components::AffixFuzzer10, + pub fuzz2011: crate::components::AffixFuzzer11, + pub fuzz2012: crate::components::AffixFuzzer12, + pub fuzz2013: crate::components::AffixFuzzer13, + pub fuzz2101: Vec, + pub fuzz2102: Vec, + pub fuzz2103: Vec, + pub fuzz2104: Vec, + pub fuzz2105: Vec, + pub fuzz2106: Vec, + pub fuzz2107: Vec, + pub fuzz2108: Vec, + pub fuzz2109: Vec, + pub fuzz2110: Vec, + pub fuzz2111: Vec, + pub fuzz2112: Vec, + pub fuzz2113: Vec, } impl AffixFuzzer1 { @@ -688,515 +688,480 @@ impl crate::Archetype for AffixFuzzer1 { .transpose()? }, { - self.fuzz2001 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer1".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer1".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2001", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - self.fuzz2002 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer2".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer2".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2002", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - self.fuzz2003 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer3".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer3".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2003", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2001], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer1".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer1".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2001", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2004 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer4".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer4".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2004", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2002], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer2".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer2".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2002", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2005 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer5".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer5".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2005", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2003], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer3".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer3".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2003", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2006 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer6".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer6".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2006", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2004], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer4".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer4".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2004", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2007 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer7".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer7".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2007", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2005], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer5".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer5".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2005", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2008 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer8".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer8".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2008", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2006], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer6".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer6".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2006", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2009 - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer9".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer9".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2009", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2007], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer7".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer7".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2007", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2010 - .as_ref() - .map(|single| { - let array = - ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer10".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer10".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2010", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2008], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer8".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer8".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2008", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2011 - .as_ref() - .map(|single| { - let array = - ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer11".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer11".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2011", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2009], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer9".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer9".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2009", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2012 - .as_ref() - .map(|single| { - let array = - ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer12".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer12".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2012", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2010], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer10".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer10".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2010", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2013 - .as_ref() - .map(|single| { - let array = - ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer13".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer13".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2013", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2011], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer11".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer11".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2011", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2101 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer1".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer1".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2101", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2012], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer12".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer12".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2012", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2102 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer2".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer2".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2102", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow([&self.fuzz2013], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer13".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer13".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2013", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2103 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer3".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer3".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2103", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow(self.fuzz2101.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer1".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer1".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2101", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2104 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer4".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer4".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2104", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow(self.fuzz2102.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer2".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer2".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2102", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2105 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer5".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer5".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2105", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow(self.fuzz2103.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer3".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer3".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2103", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2106 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer6".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer6".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2106", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow(self.fuzz2104.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer4".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer4".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2104", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2107 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer7".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer7".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2107", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow(self.fuzz2105.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer5".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer5".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2105", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2108 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer8".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer8".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2108", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow(self.fuzz2106.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer6".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer6".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2106", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2109 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer9".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer9".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2109", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = + ::try_to_arrow(self.fuzz2107.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer7".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer7".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2107", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + Some({ + let array = + ::try_to_arrow(self.fuzz2108.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer8".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer8".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2108", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + Some({ + let array = + ::try_to_arrow(self.fuzz2109.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer9".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer9".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2109", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2110 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer10".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer10".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2110", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = ::try_to_arrow( + self.fuzz2110.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer10".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer10".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2110", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2111 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer11".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer11".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2111", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = ::try_to_arrow( + self.fuzz2111.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer11".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer11".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2111", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2112 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer12".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer12".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2112", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = ::try_to_arrow( + self.fuzz2112.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer12".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer12".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2112", datatype, false), + array, + ) + }) + }) + .transpose()? }, { - self.fuzz2113 - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer13".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer13".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2113", datatype, false), - array, - ) - }) - }) - .transpose()? + Some({ + let array = ::try_to_arrow( + self.fuzz2113.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer13".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer13".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2113", datatype, false), + array, + ) + }) + }) + .transpose()? }, ] .into_iter() @@ -1227,8 +1192,385 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1002 = { - let array = arrays_by_name.get("fuzz1002").ok_or_else(|| { + let fuzz1002 = { + let array = arrays_by_name.get("fuzz1002").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1003 = { + let array = arrays_by_name.get("fuzz1003").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1004 = { + let array = arrays_by_name.get("fuzz1004").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1005 = { + let array = arrays_by_name.get("fuzz1005").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1006 = { + let array = arrays_by_name.get("fuzz1006").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1007 = { + let array = arrays_by_name.get("fuzz1007").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1008 = { + let array = arrays_by_name.get("fuzz1008").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1009 = { + let array = arrays_by_name.get("fuzz1009").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1010 = { + let array = arrays_by_name.get("fuzz1010").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1011 = { + let array = arrays_by_name.get("fuzz1011").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1012 = { + let array = arrays_by_name.get("fuzz1012").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1013 = { + let array = arrays_by_name.get("fuzz1013").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz1101 = { + let array = arrays_by_name.get("fuzz1101").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1102 = { + let array = arrays_by_name.get("fuzz1102").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1103 = { + let array = arrays_by_name.get("fuzz1103").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1104 = { + let array = arrays_by_name.get("fuzz1104").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1105 = { + let array = arrays_by_name.get("fuzz1105").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1106 = { + let array = arrays_by_name.get("fuzz1106").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1107 = { + let array = arrays_by_name.get("fuzz1107").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1108 = { + let array = arrays_by_name.get("fuzz1108").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1109 = { + let array = arrays_by_name.get("fuzz1109").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1110 = { + let array = arrays_by_name.get("fuzz1110").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1111 = { + let array = arrays_by_name.get("fuzz1111").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1112 = { + let array = arrays_by_name.get("fuzz1112").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz1113 = { + let array = arrays_by_name.get("fuzz1113").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()? + }; + let fuzz2001 = { + let array = arrays_by_name.get("fuzz2001").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? + }; + let fuzz2002 = { + let array = arrays_by_name.get("fuzz2002").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1241,8 +1583,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1003 = { - let array = arrays_by_name.get("fuzz1003").ok_or_else(|| { + let fuzz2003 = { + let array = arrays_by_name.get("fuzz2003").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1255,8 +1597,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1004 = { - let array = arrays_by_name.get("fuzz1004").ok_or_else(|| { + let fuzz2004 = { + let array = arrays_by_name.get("fuzz2004").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1269,8 +1611,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1005 = { - let array = arrays_by_name.get("fuzz1005").ok_or_else(|| { + let fuzz2005 = { + let array = arrays_by_name.get("fuzz2005").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1283,8 +1625,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1006 = { - let array = arrays_by_name.get("fuzz1006").ok_or_else(|| { + let fuzz2006 = { + let array = arrays_by_name.get("fuzz2006").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1297,8 +1639,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1007 = { - let array = arrays_by_name.get("fuzz1007").ok_or_else(|| { + let fuzz2007 = { + let array = arrays_by_name.get("fuzz2007").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1311,8 +1653,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1008 = { - let array = arrays_by_name.get("fuzz1008").ok_or_else(|| { + let fuzz2008 = { + let array = arrays_by_name.get("fuzz2008").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1325,8 +1667,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1009 = { - let array = arrays_by_name.get("fuzz1009").ok_or_else(|| { + let fuzz2009 = { + let array = arrays_by_name.get("fuzz2009").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1339,8 +1681,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1010 = { - let array = arrays_by_name.get("fuzz1010").ok_or_else(|| { + let fuzz2010 = { + let array = arrays_by_name.get("fuzz2010").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1353,8 +1695,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1011 = { - let array = arrays_by_name.get("fuzz1011").ok_or_else(|| { + let fuzz2011 = { + let array = arrays_by_name.get("fuzz2011").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1367,8 +1709,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1012 = { - let array = arrays_by_name.get("fuzz1012").ok_or_else(|| { + let fuzz2012 = { + let array = arrays_by_name.get("fuzz2012").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1381,8 +1723,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1013 = { - let array = arrays_by_name.get("fuzz1013").ok_or_else(|| { + let fuzz2013 = { + let array = arrays_by_name.get("fuzz2013").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1395,8 +1737,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz1101 = { - let array = arrays_by_name.get("fuzz1101").ok_or_else(|| { + let fuzz2101 = { + let array = arrays_by_name.get("fuzz2101").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1410,8 +1752,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1102 = { - let array = arrays_by_name.get("fuzz1102").ok_or_else(|| { + let fuzz2102 = { + let array = arrays_by_name.get("fuzz2102").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1425,8 +1767,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1103 = { - let array = arrays_by_name.get("fuzz1103").ok_or_else(|| { + let fuzz2103 = { + let array = arrays_by_name.get("fuzz2103").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1440,8 +1782,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1104 = { - let array = arrays_by_name.get("fuzz1104").ok_or_else(|| { + let fuzz2104 = { + let array = arrays_by_name.get("fuzz2104").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1455,8 +1797,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1105 = { - let array = arrays_by_name.get("fuzz1105").ok_or_else(|| { + let fuzz2105 = { + let array = arrays_by_name.get("fuzz2105").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1470,8 +1812,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1106 = { - let array = arrays_by_name.get("fuzz1106").ok_or_else(|| { + let fuzz2106 = { + let array = arrays_by_name.get("fuzz2106").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1485,8 +1827,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1107 = { - let array = arrays_by_name.get("fuzz1107").ok_or_else(|| { + let fuzz2107 = { + let array = arrays_by_name.get("fuzz2107").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1500,8 +1842,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1108 = { - let array = arrays_by_name.get("fuzz1108").ok_or_else(|| { + let fuzz2108 = { + let array = arrays_by_name.get("fuzz2108").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1515,8 +1857,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1109 = { - let array = arrays_by_name.get("fuzz1109").ok_or_else(|| { + let fuzz2109 = { + let array = arrays_by_name.get("fuzz2109").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1530,8 +1872,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1110 = { - let array = arrays_by_name.get("fuzz1110").ok_or_else(|| { + let fuzz2110 = { + let array = arrays_by_name.get("fuzz2110").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1545,8 +1887,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1111 = { - let array = arrays_by_name.get("fuzz1111").ok_or_else(|| { + let fuzz2111 = { + let array = arrays_by_name.get("fuzz2111").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1560,8 +1902,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1112 = { - let array = arrays_by_name.get("fuzz1112").ok_or_else(|| { + let fuzz2112 = { + let array = arrays_by_name.get("fuzz2112").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1575,8 +1917,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz1113 = { - let array = arrays_by_name.get("fuzz1113").ok_or_else(|| { + let fuzz2113 = { + let array = arrays_by_name.get("fuzz2113").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1590,357 +1932,6 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2001 = if let Some(array) = arrays_by_name.get("fuzz2001") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2002 = if let Some(array) = arrays_by_name.get("fuzz2002") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2003 = if let Some(array) = arrays_by_name.get("fuzz2003") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2004 = if let Some(array) = arrays_by_name.get("fuzz2004") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2005 = if let Some(array) = arrays_by_name.get("fuzz2005") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2006 = if let Some(array) = arrays_by_name.get("fuzz2006") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2007 = if let Some(array) = arrays_by_name.get("fuzz2007") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2008 = if let Some(array) = arrays_by_name.get("fuzz2008") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2009 = if let Some(array) = arrays_by_name.get("fuzz2009") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2010 = if let Some(array) = arrays_by_name.get("fuzz2010") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2011 = if let Some(array) = arrays_by_name.get("fuzz2011") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2012 = if let Some(array) = arrays_by_name.get("fuzz2012") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2013 = if let Some(array) = arrays_by_name.get("fuzz2013") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None - }; - let fuzz2101 = if let Some(array) = arrays_by_name.get("fuzz2101") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2102 = if let Some(array) = arrays_by_name.get("fuzz2102") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2103 = if let Some(array) = arrays_by_name.get("fuzz2103") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2104 = if let Some(array) = arrays_by_name.get("fuzz2104") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2105 = if let Some(array) = arrays_by_name.get("fuzz2105") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2106 = if let Some(array) = arrays_by_name.get("fuzz2106") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2107 = if let Some(array) = arrays_by_name.get("fuzz2107") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2108 = if let Some(array) = arrays_by_name.get("fuzz2108") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2109 = if let Some(array) = arrays_by_name.get("fuzz2109") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2110 = if let Some(array) = arrays_by_name.get("fuzz2110") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2111 = if let Some(array) = arrays_by_name.get("fuzz2111") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2112 = if let Some(array) = arrays_by_name.get("fuzz2112") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; - let fuzz2113 = if let Some(array) = arrays_by_name.get("fuzz2113") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()?, - ) - } else { - None - }; Ok(Self { fuzz1001, fuzz1002, @@ -2026,6 +2017,32 @@ impl AffixFuzzer1 { fuzz1111: impl IntoIterator>, fuzz1112: impl IntoIterator>, fuzz1113: impl IntoIterator>, + fuzz2001: impl Into, + fuzz2002: impl Into, + fuzz2003: impl Into, + fuzz2004: impl Into, + fuzz2005: impl Into, + fuzz2006: impl Into, + fuzz2007: impl Into, + fuzz2008: impl Into, + fuzz2009: impl Into, + fuzz2010: impl Into, + fuzz2011: impl Into, + fuzz2012: impl Into, + fuzz2013: impl Into, + fuzz2101: impl IntoIterator>, + fuzz2102: impl IntoIterator>, + fuzz2103: impl IntoIterator>, + fuzz2104: impl IntoIterator>, + fuzz2105: impl IntoIterator>, + fuzz2106: impl IntoIterator>, + fuzz2107: impl IntoIterator>, + fuzz2108: impl IntoIterator>, + fuzz2109: impl IntoIterator>, + fuzz2110: impl IntoIterator>, + fuzz2111: impl IntoIterator>, + fuzz2112: impl IntoIterator>, + fuzz2113: impl IntoIterator>, ) -> Self { Self { fuzz1001: fuzz1001.into(), @@ -2054,201 +2071,32 @@ impl AffixFuzzer1 { fuzz1111: fuzz1111.into_iter().map(Into::into).collect(), fuzz1112: fuzz1112.into_iter().map(Into::into).collect(), fuzz1113: fuzz1113.into_iter().map(Into::into).collect(), - fuzz2001: None, - fuzz2002: None, - fuzz2003: None, - fuzz2004: None, - fuzz2005: None, - fuzz2006: None, - fuzz2007: None, - fuzz2008: None, - fuzz2009: None, - fuzz2010: None, - fuzz2011: None, - fuzz2012: None, - fuzz2013: None, - fuzz2101: None, - fuzz2102: None, - fuzz2103: None, - fuzz2104: None, - fuzz2105: None, - fuzz2106: None, - fuzz2107: None, - fuzz2108: None, - fuzz2109: None, - fuzz2110: None, - fuzz2111: None, - fuzz2112: None, - fuzz2113: None, + fuzz2001: fuzz2001.into(), + fuzz2002: fuzz2002.into(), + fuzz2003: fuzz2003.into(), + fuzz2004: fuzz2004.into(), + fuzz2005: fuzz2005.into(), + fuzz2006: fuzz2006.into(), + fuzz2007: fuzz2007.into(), + fuzz2008: fuzz2008.into(), + fuzz2009: fuzz2009.into(), + fuzz2010: fuzz2010.into(), + fuzz2011: fuzz2011.into(), + fuzz2012: fuzz2012.into(), + fuzz2013: fuzz2013.into(), + fuzz2101: fuzz2101.into_iter().map(Into::into).collect(), + fuzz2102: fuzz2102.into_iter().map(Into::into).collect(), + fuzz2103: fuzz2103.into_iter().map(Into::into).collect(), + fuzz2104: fuzz2104.into_iter().map(Into::into).collect(), + fuzz2105: fuzz2105.into_iter().map(Into::into).collect(), + fuzz2106: fuzz2106.into_iter().map(Into::into).collect(), + fuzz2107: fuzz2107.into_iter().map(Into::into).collect(), + fuzz2108: fuzz2108.into_iter().map(Into::into).collect(), + fuzz2109: fuzz2109.into_iter().map(Into::into).collect(), + fuzz2110: fuzz2110.into_iter().map(Into::into).collect(), + fuzz2111: fuzz2111.into_iter().map(Into::into).collect(), + fuzz2112: fuzz2112.into_iter().map(Into::into).collect(), + fuzz2113: fuzz2113.into_iter().map(Into::into).collect(), } } - - pub fn with_fuzz2001(mut self, fuzz2001: impl Into) -> Self { - self.fuzz2001 = Some(fuzz2001.into()); - self - } - - pub fn with_fuzz2002(mut self, fuzz2002: impl Into) -> Self { - self.fuzz2002 = Some(fuzz2002.into()); - self - } - - pub fn with_fuzz2003(mut self, fuzz2003: impl Into) -> Self { - self.fuzz2003 = Some(fuzz2003.into()); - self - } - - pub fn with_fuzz2004(mut self, fuzz2004: impl Into) -> Self { - self.fuzz2004 = Some(fuzz2004.into()); - self - } - - pub fn with_fuzz2005(mut self, fuzz2005: impl Into) -> Self { - self.fuzz2005 = Some(fuzz2005.into()); - self - } - - pub fn with_fuzz2006(mut self, fuzz2006: impl Into) -> Self { - self.fuzz2006 = Some(fuzz2006.into()); - self - } - - pub fn with_fuzz2007(mut self, fuzz2007: impl Into) -> Self { - self.fuzz2007 = Some(fuzz2007.into()); - self - } - - pub fn with_fuzz2008(mut self, fuzz2008: impl Into) -> Self { - self.fuzz2008 = Some(fuzz2008.into()); - self - } - - pub fn with_fuzz2009(mut self, fuzz2009: impl Into) -> Self { - self.fuzz2009 = Some(fuzz2009.into()); - self - } - - pub fn with_fuzz2010(mut self, fuzz2010: impl Into) -> Self { - self.fuzz2010 = Some(fuzz2010.into()); - self - } - - pub fn with_fuzz2011(mut self, fuzz2011: impl Into) -> Self { - self.fuzz2011 = Some(fuzz2011.into()); - self - } - - pub fn with_fuzz2012(mut self, fuzz2012: impl Into) -> Self { - self.fuzz2012 = Some(fuzz2012.into()); - self - } - - pub fn with_fuzz2013(mut self, fuzz2013: impl Into) -> Self { - self.fuzz2013 = Some(fuzz2013.into()); - self - } - - pub fn with_fuzz2101( - mut self, - fuzz2101: impl IntoIterator>, - ) -> Self { - self.fuzz2101 = Some(fuzz2101.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2102( - mut self, - fuzz2102: impl IntoIterator>, - ) -> Self { - self.fuzz2102 = Some(fuzz2102.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2103( - mut self, - fuzz2103: impl IntoIterator>, - ) -> Self { - self.fuzz2103 = Some(fuzz2103.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2104( - mut self, - fuzz2104: impl IntoIterator>, - ) -> Self { - self.fuzz2104 = Some(fuzz2104.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2105( - mut self, - fuzz2105: impl IntoIterator>, - ) -> Self { - self.fuzz2105 = Some(fuzz2105.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2106( - mut self, - fuzz2106: impl IntoIterator>, - ) -> Self { - self.fuzz2106 = Some(fuzz2106.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2107( - mut self, - fuzz2107: impl IntoIterator>, - ) -> Self { - self.fuzz2107 = Some(fuzz2107.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2108( - mut self, - fuzz2108: impl IntoIterator>, - ) -> Self { - self.fuzz2108 = Some(fuzz2108.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2109( - mut self, - fuzz2109: impl IntoIterator>, - ) -> Self { - self.fuzz2109 = Some(fuzz2109.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2110( - mut self, - fuzz2110: impl IntoIterator>, - ) -> Self { - self.fuzz2110 = Some(fuzz2110.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2111( - mut self, - fuzz2111: impl IntoIterator>, - ) -> Self { - self.fuzz2111 = Some(fuzz2111.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2112( - mut self, - fuzz2112: impl IntoIterator>, - ) -> Self { - self.fuzz2112 = Some(fuzz2112.into_iter().map(Into::into).collect()); - self - } - - pub fn with_fuzz2113( - mut self, - fuzz2113: impl IntoIterator>, - ) -> Self { - self.fuzz2113 = Some(fuzz2113.into_iter().map(Into::into).collect()); - self - } } diff --git a/crates/re_types/src/archetypes/points2d.rs b/crates/re_types/src/archetypes/points2d.rs index 57db44037fdb..33041a32497d 100644 --- a/crates/re_types/src/archetypes/points2d.rs +++ b/crates/re_types/src/archetypes/points2d.rs @@ -46,24 +46,24 @@ pub struct Points2D { pub points: Vec, #[doc = "Optional radii for the points, effectively turning them into circles."] - pub radii: Option>, + pub radii: Vec, #[doc = "Optional colors for the points."] - pub colors: Option>, + pub colors: Vec, #[doc = "Optional text labels for the points."] - pub labels: Option>, + pub labels: Vec, #[doc = "An optional floating point value that specifies the 2D drawing order."] #[doc = "Objects with higher values are drawn on top of those with lower values."] #[doc = ""] #[doc = "The default for 2D points is 30.0."] - pub draw_order: Option, + pub draw_order: crate::components::DrawOrder, #[doc = "Optional class Ids for the points."] #[doc = ""] #[doc = "The class ID provides colors and labels if not specified explicitly."] - pub class_ids: Option>, + pub class_ids: Vec, #[doc = "Optional keypoint IDs for the points, identifying them within a class."] #[doc = ""] @@ -73,10 +73,10 @@ pub struct Points2D { #[doc = "with `class_id`)."] #[doc = "E.g. the classification might be 'Person' and the keypoints refer to joints on a"] #[doc = "detected skeleton."] - pub keypoint_ids: Option>, + pub keypoint_ids: Vec, #[doc = "Unique identifiers for each individual point in the batch."] - pub instance_keys: Option>, + pub instance_keys: Vec, } impl Points2D { @@ -156,139 +156,131 @@ impl crate::Archetype for Points2D { .transpose()? }, { - self.radii - .as_ref() - .map(|many| { - let array = ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Radius".into(), - Box::new(array.data_type().clone()), - Some("rerun.radius".into()), - ); - ( - ::arrow2::datatypes::Field::new("radii", datatype, false), - array, - ) - }) + Some({ + let array = ::try_to_arrow(self.radii.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Radius".into(), + Box::new(array.data_type().clone()), + Some("rerun.radius".into()), + ); + ( + ::arrow2::datatypes::Field::new("radii", datatype, false), + array, + ) }) - .transpose()? + }) + .transpose()? }, { - self.colors - .as_ref() - .map(|many| { - let array = ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Color".into(), - Box::new(array.data_type().clone()), - Some("rerun.colorrgba".into()), - ); - ( - ::arrow2::datatypes::Field::new("colors", datatype, false), - array, - ) - }) + Some({ + let array = ::try_to_arrow(self.colors.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Color".into(), + Box::new(array.data_type().clone()), + Some("rerun.colorrgba".into()), + ); + ( + ::arrow2::datatypes::Field::new("colors", datatype, false), + array, + ) }) - .transpose()? + }) + .transpose()? }, { - self.labels - .as_ref() - .map(|many| { - let array = ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Label".into(), - Box::new(array.data_type().clone()), - Some("rerun.label".into()), - ); - ( - ::arrow2::datatypes::Field::new("labels", datatype, false), - array, - ) - }) + Some({ + let array = ::try_to_arrow(self.labels.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Label".into(), + Box::new(array.data_type().clone()), + Some("rerun.label".into()), + ); + ( + ::arrow2::datatypes::Field::new("labels", datatype, false), + array, + ) }) - .transpose()? + }) + .transpose()? }, { - self.draw_order - .as_ref() - .map(|single| { - let array = ::try_to_arrow([single], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.DrawOrder".into(), - Box::new(array.data_type().clone()), - Some("rerun.draw_order".into()), - ); - ( - ::arrow2::datatypes::Field::new("draw_order", datatype, false), - array, - ) - }) + Some({ + let array = + ::try_to_arrow([&self.draw_order], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.DrawOrder".into(), + Box::new(array.data_type().clone()), + Some("rerun.draw_order".into()), + ); + ( + ::arrow2::datatypes::Field::new("draw_order", datatype, false), + array, + ) }) - .transpose()? + }) + .transpose()? }, { - self.class_ids - .as_ref() - .map(|many| { - let array = ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.ClassId".into(), - Box::new(array.data_type().clone()), - Some("rerun.class_id".into()), - ); - ( - ::arrow2::datatypes::Field::new("class_ids", datatype, false), - array, - ) - }) + Some({ + let array = + ::try_to_arrow(self.class_ids.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.ClassId".into(), + Box::new(array.data_type().clone()), + Some("rerun.class_id".into()), + ); + ( + ::arrow2::datatypes::Field::new("class_ids", datatype, false), + array, + ) }) - .transpose()? + }) + .transpose()? }, { - self.keypoint_ids - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.KeypointId".into(), - Box::new(array.data_type().clone()), - Some("rerun.keypoint_id".into()), - ); - ( - ::arrow2::datatypes::Field::new("keypoint_ids", datatype, false), - array, - ) - }) + Some({ + let array = ::try_to_arrow( + self.keypoint_ids.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.KeypointId".into(), + Box::new(array.data_type().clone()), + Some("rerun.keypoint_id".into()), + ); + ( + ::arrow2::datatypes::Field::new("keypoint_ids", datatype, false), + array, + ) }) - .transpose()? + }) + .transpose()? }, { - self.instance_keys - .as_ref() - .map(|many| { - let array = - ::try_to_arrow(many.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.InstanceKey".into(), - Box::new(array.data_type().clone()), - Some("rerun.instance_key".into()), - ); - ( - ::arrow2::datatypes::Field::new("instance_keys", datatype, false), - array, - ) - }) + Some({ + let array = ::try_to_arrow( + self.instance_keys.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.InstanceKey".into(), + Box::new(array.data_type().clone()), + Some("rerun.instance_key".into()), + ); + ( + ::arrow2::datatypes::Field::new("instance_keys", datatype, false), + array, + ) }) - .transpose()? + }) + .transpose()? }, ] .into_iter() @@ -320,102 +312,109 @@ impl crate::Archetype for Points2D { }) .collect::>>()? }; - let radii = if let Some(array) = arrays_by_name.get("radii") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) + let radii = { + let array = arrays_by_name.get("radii").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, }) - .collect::>>()?, - ) - } else { - None + }) + .collect::>>()? }; - let colors = if let Some(array) = arrays_by_name.get("colors") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) + let colors = { + let array = arrays_by_name.get("colors").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, }) - .collect::>>()?, - ) - } else { - None + }) + .collect::>>()? }; - let labels = if let Some(array) = arrays_by_name.get("labels") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) + let labels = { + let array = arrays_by_name.get("labels").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, }) - .collect::>>()?, - ) - } else { - None + }) + .collect::>>()? }; - let draw_order = if let Some(array) = arrays_by_name.get("draw_order") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })?, - ) - } else { - None + let draw_order = { + let array = arrays_by_name.get("draw_order").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })? }; - let class_ids = if let Some(array) = arrays_by_name.get("class_ids") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) + let class_ids = { + let array = arrays_by_name.get("class_ids").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, }) - .collect::>>()?, - ) - } else { - None + }) + .collect::>>()? }; - let keypoint_ids = if let Some(array) = arrays_by_name.get("keypoint_ids") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) + let keypoint_ids = { + let array = arrays_by_name.get("keypoint_ids").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, }) - .collect::>>()?, - ) - } else { - None + }) + .collect::>>()? }; - let instance_keys = if let Some(array) = arrays_by_name.get("instance_keys") { - Some( - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) + let instance_keys = { + let array = arrays_by_name.get("instance_keys").ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + } + })?; + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, }) - .collect::>>()?, - ) - } else { - None + }) + .collect::>>()? }; Ok(Self { points, @@ -431,69 +430,25 @@ impl crate::Archetype for Points2D { } impl Points2D { - pub fn new(points: impl IntoIterator>) -> Self { - Self { - points: points.into_iter().map(Into::into).collect(), - radii: None, - colors: None, - labels: None, - draw_order: None, - class_ids: None, - keypoint_ids: None, - instance_keys: None, - } - } - - pub fn with_radii( - mut self, + pub fn new( + points: impl IntoIterator>, radii: impl IntoIterator>, - ) -> Self { - self.radii = Some(radii.into_iter().map(Into::into).collect()); - self - } - - pub fn with_colors( - mut self, colors: impl IntoIterator>, - ) -> Self { - self.colors = Some(colors.into_iter().map(Into::into).collect()); - self - } - - pub fn with_labels( - mut self, labels: impl IntoIterator>, - ) -> Self { - self.labels = Some(labels.into_iter().map(Into::into).collect()); - self - } - - pub fn with_draw_order(mut self, draw_order: impl Into) -> Self { - self.draw_order = Some(draw_order.into()); - self - } - - pub fn with_class_ids( - mut self, + draw_order: impl Into, class_ids: impl IntoIterator>, - ) -> Self { - self.class_ids = Some(class_ids.into_iter().map(Into::into).collect()); - self - } - - pub fn with_keypoint_ids( - mut self, keypoint_ids: impl IntoIterator>, - ) -> Self { - self.keypoint_ids = Some(keypoint_ids.into_iter().map(Into::into).collect()); - self - } - - pub fn with_instance_keys( - mut self, instance_keys: impl IntoIterator>, ) -> Self { - self.instance_keys = Some(instance_keys.into_iter().map(Into::into).collect()); - self + Self { + points: points.into_iter().map(Into::into).collect(), + radii: radii.into_iter().map(Into::into).collect(), + colors: colors.into_iter().map(Into::into).collect(), + labels: labels.into_iter().map(Into::into).collect(), + draw_order: draw_order.into(), + class_ids: class_ids.into_iter().map(Into::into).collect(), + keypoint_ids: keypoint_ids.into_iter().map(Into::into).collect(), + instance_keys: instance_keys.into_iter().map(Into::into).collect(), + } } } diff --git a/crates/re_types/src/components/fuzzy.rs b/crates/re_types/src/components/fuzzy.rs index a1d1ef6d2105..ec772023718b 100644 --- a/crates/re_types/src/components/fuzzy.rs +++ b/crates/re_types/src/components/fuzzy.rs @@ -42,7 +42,7 @@ impl crate::Component for AffixFuzzer1 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -54,7 +54,7 @@ impl crate::Component for AffixFuzzer1 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -62,10 +62,10 @@ impl crate::Component for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -84,10 +84,10 @@ impl crate::Component for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -101,7 +101,7 @@ impl crate::Component for AffixFuzzer1 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, @@ -199,7 +199,7 @@ impl crate::Component for AffixFuzzer2 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -211,7 +211,7 @@ impl crate::Component for AffixFuzzer2 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -219,10 +219,10 @@ impl crate::Component for AffixFuzzer2 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -241,10 +241,10 @@ impl crate::Component for AffixFuzzer2 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -258,7 +258,7 @@ impl crate::Component for AffixFuzzer2 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, @@ -358,7 +358,7 @@ impl crate::Component for AffixFuzzer3 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -370,7 +370,7 @@ impl crate::Component for AffixFuzzer3 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -378,10 +378,10 @@ impl crate::Component for AffixFuzzer3 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -400,10 +400,10 @@ impl crate::Component for AffixFuzzer3 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -417,7 +417,7 @@ impl crate::Component for AffixFuzzer3 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, @@ -486,7 +486,7 @@ impl crate::Component for AffixFuzzer3 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer4 { - pub single_optional: Option, + pub single_optional: crate::datatypes::AffixFuzzer1, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer4> { @@ -517,7 +517,7 @@ impl crate::Component for AffixFuzzer4 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -529,7 +529,7 @@ impl crate::Component for AffixFuzzer4 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -537,10 +537,10 @@ impl crate::Component for AffixFuzzer4 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -559,10 +559,10 @@ impl crate::Component for AffixFuzzer4 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -576,7 +576,7 @@ impl crate::Component for AffixFuzzer4 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, @@ -600,12 +600,10 @@ impl crate::Component for AffixFuzzer4 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self { single_optional } = datum.into_owned(); - single_optional - }) - .flatten(); + let datum = datum.map(|datum| { + let Self { single_optional } = datum.into_owned(); + single_optional + }); (datum.is_some(), datum) }) .unzip(); @@ -635,14 +633,18 @@ impl crate::Component for AffixFuzzer4 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| res.map(|single_optional| Some(Self { single_optional }))) .collect::>>>()?) } } #[derive(Debug, Clone, PartialEq)] -pub struct AffixFuzzer5(pub Option); +pub struct AffixFuzzer5(pub crate::datatypes::AffixFuzzer1); impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer5> { #[inline] @@ -672,7 +674,7 @@ impl crate::Component for AffixFuzzer5 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -684,7 +686,7 @@ impl crate::Component for AffixFuzzer5 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -692,10 +694,10 @@ impl crate::Component for AffixFuzzer5 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -714,10 +716,10 @@ impl crate::Component for AffixFuzzer5 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -731,7 +733,7 @@ impl crate::Component for AffixFuzzer5 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, @@ -755,12 +757,10 @@ impl crate::Component for AffixFuzzer5 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self(data0) = datum.into_owned(); - data0 - }) - .flatten(); + let datum = datum.map(|datum| { + let Self(data0) = datum.into_owned(); + data0 + }); (datum.is_some(), datum) }) .unzip(); @@ -790,7 +790,11 @@ impl crate::Component for AffixFuzzer5 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>()?) } @@ -798,7 +802,7 @@ impl crate::Component for AffixFuzzer5 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer6 { - pub single_optional: Option, + pub single_optional: crate::datatypes::AffixFuzzer1, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer6> { @@ -829,7 +833,7 @@ impl crate::Component for AffixFuzzer6 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -841,7 +845,7 @@ impl crate::Component for AffixFuzzer6 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -849,10 +853,10 @@ impl crate::Component for AffixFuzzer6 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -871,10 +875,10 @@ impl crate::Component for AffixFuzzer6 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -888,7 +892,7 @@ impl crate::Component for AffixFuzzer6 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, @@ -912,12 +916,10 @@ impl crate::Component for AffixFuzzer6 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self { single_optional } = datum.into_owned(); - single_optional - }) - .flatten(); + let datum = datum.map(|datum| { + let Self { single_optional } = datum.into_owned(); + single_optional + }); (datum.is_some(), datum) }) .unzip(); @@ -947,7 +949,11 @@ impl crate::Component for AffixFuzzer6 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| res.map(|single_optional| Some(Self { single_optional }))) .collect::>>>()?) } @@ -955,7 +961,7 @@ impl crate::Component for AffixFuzzer6 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer7 { - pub many_optional: Option>, + pub many_optional: Vec, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer7> { @@ -988,7 +994,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1000,7 +1006,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1008,10 +1014,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1030,10 +1036,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1047,14 +1053,14 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, metadata: [].into(), }, ]), - is_nullable: true, + is_nullable: false, metadata: [].into(), })) } @@ -1074,12 +1080,10 @@ impl crate::Component for AffixFuzzer7 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self { many_optional } = datum.into_owned(); - many_optional - }) - .flatten(); + let datum = datum.map(|datum| { + let Self { many_optional } = datum.into_owned(); + many_optional + }); (datum.is_some(), datum) }) .unzip(); @@ -1123,7 +1127,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1135,7 +1139,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1143,10 +1147,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1165,10 +1169,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1182,14 +1186,14 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, metadata: [].into(), }, ]), - is_nullable: true, + is_nullable: false, metadata: [].into(), }))), None, @@ -1242,7 +1246,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1254,7 +1258,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1262,10 +1266,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1284,10 +1288,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -1301,7 +1305,7 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, @@ -1332,7 +1336,11 @@ impl crate::Component for AffixFuzzer7 { .collect::>>>()? .into_iter() } - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| res.map(|many_optional| Some(Self { many_optional }))) .collect::>>>()?) } @@ -1340,7 +1348,7 @@ impl crate::Component for AffixFuzzer7 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer8 { - pub single_float_optional: Option, + pub single_float_optional: f32, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer8> { @@ -1385,14 +1393,12 @@ impl crate::Component for AffixFuzzer8 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self { - single_float_optional, - } = datum.into_owned(); - single_float_optional - }) - .flatten(); + let datum = datum.map(|datum| { + let Self { + single_float_optional, + } = datum.into_owned(); + single_float_optional + }); (datum.is_some(), datum) }) .unzip(); @@ -1436,7 +1442,11 @@ impl crate::Component for AffixFuzzer8 { .unwrap() .into_iter() .map(|v| v.copied()) - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| { res.map(|single_float_optional| { Some(Self { @@ -1577,7 +1587,7 @@ impl crate::Component for AffixFuzzer9 { #[derive(Debug, Clone, PartialEq, Eq)] pub struct AffixFuzzer10 { - pub single_string_optional: Option, + pub single_string_optional: String, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer10> { @@ -1622,14 +1632,12 @@ impl crate::Component for AffixFuzzer10 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self { - single_string_optional, - } = datum.into_owned(); - single_string_optional - }) - .flatten(); + let datum = datum.map(|datum| { + let Self { + single_string_optional, + } = datum.into_owned(); + single_string_optional + }); (datum.is_some(), datum) }) .unzip(); @@ -1688,7 +1696,11 @@ impl crate::Component for AffixFuzzer10 { .unwrap() .into_iter() .map(|v| v.map(ToOwned::to_owned)) - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| { res.map(|single_string_optional| { Some(Self { @@ -1702,7 +1714,7 @@ impl crate::Component for AffixFuzzer10 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer11 { - pub many_floats_optional: Option>, + pub many_floats_optional: Vec, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer11> { @@ -1732,7 +1744,7 @@ impl crate::Component for AffixFuzzer11 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })) } @@ -1752,14 +1764,12 @@ impl crate::Component for AffixFuzzer11 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self { - many_floats_optional, - } = datum.into_owned(); - many_floats_optional - }) - .flatten(); + let datum = datum.map(|datum| { + let Self { + many_floats_optional, + } = datum.into_owned(); + many_floats_optional + }); (datum.is_some(), datum) }) .unzip(); @@ -1800,7 +1810,7 @@ impl crate::Component for AffixFuzzer11 { Box::new(DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }))), None, @@ -1888,7 +1898,11 @@ impl crate::Component for AffixFuzzer11 { .collect::>>>()? .into_iter() } - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| { res.map(|many_floats_optional| { Some(Self { @@ -2120,7 +2134,7 @@ impl crate::Component for AffixFuzzer12 { #[derive(Debug, Clone, PartialEq, Eq)] pub struct AffixFuzzer13 { - pub many_strings_optional: Option>, + pub many_strings_optional: Vec, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer13> { @@ -2150,7 +2164,7 @@ impl crate::Component for AffixFuzzer13 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })) } @@ -2170,14 +2184,12 @@ impl crate::Component for AffixFuzzer13 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self { - many_strings_optional, - } = datum.into_owned(); - many_strings_optional - }) - .flatten(); + let datum = datum.map(|datum| { + let Self { + many_strings_optional, + } = datum.into_owned(); + many_strings_optional + }); (datum.is_some(), datum) }) .unzip(); @@ -2218,7 +2230,7 @@ impl crate::Component for AffixFuzzer13 { Box::new(DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }))), None, @@ -2322,7 +2334,11 @@ impl crate::Component for AffixFuzzer13 { .collect::>>>()? .into_iter() } - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| { res.map(|many_strings_optional| { Some(Self { diff --git a/crates/re_types/src/datatypes/fuzzy.rs b/crates/re_types/src/datatypes/fuzzy.rs index 567010f20a43..c73fbbeb3f7b 100644 --- a/crates/re_types/src/datatypes/fuzzy.rs +++ b/crates/re_types/src/datatypes/fuzzy.rs @@ -11,7 +11,7 @@ #[derive(Debug, Clone, PartialEq)] pub struct FlattenedScalar { - pub value: Option, + pub value: f32, } impl<'a> From for ::std::borrow::Cow<'a, FlattenedScalar> { @@ -41,7 +41,7 @@ impl crate::Datatype for FlattenedScalar { DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]) } @@ -84,13 +84,10 @@ impl crate::Datatype for FlattenedScalar { let (somes, value): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum - .as_ref() - .map(|datum| { - let Self { value, .. } = &**datum; - value.clone() - }) - .flatten(); + let datum = datum.as_ref().map(|datum| { + let Self { value, .. } = &**datum; + value.clone() + }); (datum.is_some(), datum) }) .unzip(); @@ -150,7 +147,19 @@ impl crate::Datatype for FlattenedScalar { }; ::itertools::izip!(value) .enumerate() - .map(|(i, (value))| is_valid(i).then(|| Ok(Self { value })).transpose()) + .map(|(i, (value))| { + is_valid(i) + .then(|| { + Ok(Self { + value: value.ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + } + })?, + }) + }) + .transpose() + }) .collect::>>()? }) } @@ -158,12 +167,12 @@ impl crate::Datatype for FlattenedScalar { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer1 { - pub single_float_optional: Option, + pub single_float_optional: f32, pub single_string_required: String, - pub single_string_optional: Option, - pub many_floats_optional: Option>, + pub single_string_optional: String, + pub many_floats_optional: Vec, pub many_strings_required: Vec, - pub many_strings_optional: Option>, + pub many_strings_optional: Vec, pub flattened_scalar: f32, pub almost_flattened_scalar: crate::datatypes::FlattenedScalar, } @@ -196,7 +205,7 @@ impl crate::Datatype for AffixFuzzer1 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -208,7 +217,7 @@ impl crate::Datatype for AffixFuzzer1 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -216,10 +225,10 @@ impl crate::Datatype for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -238,10 +247,10 @@ impl crate::Datatype for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -255,7 +264,7 @@ impl crate::Datatype for AffixFuzzer1 { data_type: DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), }]), is_nullable: false, @@ -303,16 +312,13 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, single_float_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum - .as_ref() - .map(|datum| { - let Self { - single_float_optional, - .. - } = &**datum; - single_float_optional.clone() - }) - .flatten(); + let datum = datum.as_ref().map(|datum| { + let Self { + single_float_optional, + .. + } = &**datum; + single_float_optional.clone() + }); (datum.is_some(), datum) }) .unzip(); @@ -383,16 +389,13 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, single_string_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum - .as_ref() - .map(|datum| { - let Self { - single_string_optional, - .. - } = &**datum; - single_string_optional.clone() - }) - .flatten(); + let datum = datum.as_ref().map(|datum| { + let Self { + single_string_optional, + .. + } = &**datum; + single_string_optional.clone() + }); (datum.is_some(), datum) }) .unzip(); @@ -432,16 +435,13 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, many_floats_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum - .as_ref() - .map(|datum| { - let Self { - many_floats_optional, - .. - } = &**datum; - many_floats_optional.clone() - }) - .flatten(); + let datum = datum.as_ref().map(|datum| { + let Self { + many_floats_optional, + .. + } = &**datum; + many_floats_optional.clone() + }); (datum.is_some(), datum) }) .unzip(); @@ -483,7 +483,7 @@ impl crate::Datatype for AffixFuzzer1 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: true, + is_nullable: false, metadata: [].into(), })) .to_logical_type() @@ -606,16 +606,13 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, many_strings_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum - .as_ref() - .map(|datum| { - let Self { - many_strings_optional, - .. - } = &**datum; - many_strings_optional.clone() - }) - .flatten(); + let datum = datum.as_ref().map(|datum| { + let Self { + many_strings_optional, + .. + } = &**datum; + many_strings_optional.clone() + }); (datum.is_some(), datum) }) .unzip(); @@ -657,7 +654,7 @@ impl crate::Datatype for AffixFuzzer1 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: true, + is_nullable: false, metadata: [].into(), })) .to_logical_type() @@ -1011,20 +1008,36 @@ impl crate::Datatype for AffixFuzzer1 { is_valid(i) .then(|| { Ok(Self { - single_float_optional, + single_float_optional: single_float_optional.ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + } + })?, single_string_required: single_string_required.ok_or_else( || crate::DeserializationError::MissingData { datatype: data.data_type().clone(), }, )?, - single_string_optional, - many_floats_optional, + single_string_optional: single_string_optional.ok_or_else( + || crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }, + )?, + many_floats_optional: many_floats_optional.ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + } + })?, many_strings_required: many_strings_required.ok_or_else(|| { crate::DeserializationError::MissingData { datatype: data.data_type().clone(), } })?, - many_strings_optional, + many_strings_optional: many_strings_optional.ok_or_else(|| { + crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + } + })?, flattened_scalar: flattened_scalar.ok_or_else(|| { crate::DeserializationError::MissingData { datatype: data.data_type().clone(), @@ -1046,7 +1059,7 @@ impl crate::Datatype for AffixFuzzer1 { } #[derive(Debug, Clone, PartialEq)] -pub struct AffixFuzzer2(pub Option); +pub struct AffixFuzzer2(pub f32); impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer2> { #[inline] @@ -1090,12 +1103,10 @@ impl crate::Datatype for AffixFuzzer2 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum - .map(|datum| { - let Self(data0) = datum.into_owned(); - data0 - }) - .flatten(); + let datum = datum.map(|datum| { + let Self(data0) = datum.into_owned(); + data0 + }); (datum.is_some(), datum) }) .unzip(); @@ -1136,7 +1147,11 @@ impl crate::Datatype for AffixFuzzer2 { .unwrap() .into_iter() .map(|v| v.copied()) - .map(Ok) + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>()?) } diff --git a/crates/re_types_builder/src/lib.rs b/crates/re_types_builder/src/lib.rs index d1bfe57fea5c..cc8514a3172d 100644 --- a/crates/re_types_builder/src/lib.rs +++ b/crates/re_types_builder/src/lib.rs @@ -138,6 +138,7 @@ pub use self::objects::{ // --- Attributes --- +pub const ATTR_IS_NULLABLE: &str = "is_nullable"; pub const ATTR_ORDER: &str = "order"; pub const ATTR_TRANSPARENT: &str = "transparent"; diff --git a/crates/re_types_builder/src/objects.rs b/crates/re_types_builder/src/objects.rs index 35d64b888e55..b16b3d11eee8 100644 --- a/crates/re_types_builder/src/objects.rs +++ b/crates/re_types_builder/src/objects.rs @@ -616,9 +616,7 @@ pub struct ObjectField { /// The field's `order` attribute's value, which is always mandatory. pub order: u32, - /// Whether the field is required. - /// - /// Always true for IDL definitions using flatbuffers' `struct` type (as opposed to `table`). + /// Whether the field is nullable. pub is_nullable: bool, /// Whether the field is deprecated. @@ -662,7 +660,9 @@ impl ObjectField { let attrs = Attributes::from_raw_attrs(field.attributes()); let order = attrs.get::(&fqname, crate::ATTR_ORDER); - let is_nullable = !obj.is_struct() && !field.required(); + let is_nullable = attrs + .try_get::(&fqname, crate::ATTR_IS_NULLABLE) + .is_some(); let is_deprecated = field.deprecated(); Self { @@ -714,8 +714,10 @@ impl ObjectField { let attrs = Attributes::from_raw_attrs(val.attributes()); let order = attrs.get::(&fqname, crate::ATTR_ORDER); + let is_nullable = attrs + .try_get::(&fqname, crate::ATTR_IS_NULLABLE) + .is_some(); // TODO(cmc): not sure about this, but fbs unions are a bit weird that way - let is_nullable = false; let is_deprecated = false; Self { diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py index ce6276757eaa..36ed3b9895cb 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py @@ -118,134 +118,108 @@ class AffixFuzzer1(Archetype): metadata={"component": "primary"}, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) - fuzz2001: components.AffixFuzzer1Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2001: components.AffixFuzzer1Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer1Array.from_similar, # type: ignore[misc] ) - fuzz2002: components.AffixFuzzer2Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2002: components.AffixFuzzer2Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer2Array.from_similar, # type: ignore[misc] ) - fuzz2003: components.AffixFuzzer3Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2003: components.AffixFuzzer3Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer3Array.from_similar, # type: ignore[misc] ) - fuzz2004: components.AffixFuzzer4Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2004: components.AffixFuzzer4Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer4Array.from_similar, # type: ignore[misc] ) - fuzz2005: components.AffixFuzzer5Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2005: components.AffixFuzzer5Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer5Array.from_similar, # type: ignore[misc] ) - fuzz2006: components.AffixFuzzer6Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2006: components.AffixFuzzer6Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer6Array.from_similar, # type: ignore[misc] ) - fuzz2007: components.AffixFuzzer7Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2007: components.AffixFuzzer7Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer7Array.from_similar, # type: ignore[misc] ) - fuzz2008: components.AffixFuzzer8Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2008: components.AffixFuzzer8Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer8Array.from_similar, # type: ignore[misc] ) - fuzz2009: components.AffixFuzzer9Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2009: components.AffixFuzzer9Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer9Array.from_similar, # type: ignore[misc] ) - fuzz2010: components.AffixFuzzer10Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2010: components.AffixFuzzer10Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer10Array.from_similar, # type: ignore[misc] ) - fuzz2011: components.AffixFuzzer11Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2011: components.AffixFuzzer11Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer11Array.from_similar, # type: ignore[misc] ) - fuzz2012: components.AffixFuzzer12Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2012: components.AffixFuzzer12Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer12Array.from_similar, # type: ignore[misc] ) - fuzz2013: components.AffixFuzzer13Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2013: components.AffixFuzzer13Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) - fuzz2101: components.AffixFuzzer1Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2101: components.AffixFuzzer1Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer1Array.from_similar, # type: ignore[misc] ) - fuzz2102: components.AffixFuzzer2Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2102: components.AffixFuzzer2Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer2Array.from_similar, # type: ignore[misc] ) - fuzz2103: components.AffixFuzzer3Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2103: components.AffixFuzzer3Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer3Array.from_similar, # type: ignore[misc] ) - fuzz2104: components.AffixFuzzer4Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2104: components.AffixFuzzer4Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer4Array.from_similar, # type: ignore[misc] ) - fuzz2105: components.AffixFuzzer5Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2105: components.AffixFuzzer5Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer5Array.from_similar, # type: ignore[misc] ) - fuzz2106: components.AffixFuzzer6Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2106: components.AffixFuzzer6Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer6Array.from_similar, # type: ignore[misc] ) - fuzz2107: components.AffixFuzzer7Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2107: components.AffixFuzzer7Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer7Array.from_similar, # type: ignore[misc] ) - fuzz2108: components.AffixFuzzer8Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2108: components.AffixFuzzer8Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer8Array.from_similar, # type: ignore[misc] ) - fuzz2109: components.AffixFuzzer9Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2109: components.AffixFuzzer9Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer9Array.from_similar, # type: ignore[misc] ) - fuzz2110: components.AffixFuzzer10Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2110: components.AffixFuzzer10Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer10Array.from_similar, # type: ignore[misc] ) - fuzz2111: components.AffixFuzzer11Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2111: components.AffixFuzzer11Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer11Array.from_similar, # type: ignore[misc] ) - fuzz2112: components.AffixFuzzer12Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2112: components.AffixFuzzer12Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer12Array.from_similar, # type: ignore[misc] ) - fuzz2113: components.AffixFuzzer13Array | None = field( - metadata={"component": "secondary"}, - default=None, + fuzz2113: components.AffixFuzzer13Array = field( + metadata={"component": "primary"}, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) __str__ = Archetype.__str__ diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py index 958554bfe062..30a6ba3c8537 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py @@ -39,18 +39,16 @@ class Points2D(Archetype): All the actual 2D points that make up the point cloud. """ - radii: components.RadiusArray | None = field( - metadata={"component": "secondary"}, - default=None, + radii: components.RadiusArray = field( + metadata={"component": "primary"}, converter=components.RadiusArray.from_similar, # type: ignore[misc] ) """ Optional radii for the points, effectively turning them into circles. """ - colors: components.ColorArray | None = field( - metadata={"component": "secondary"}, - default=None, + colors: components.ColorArray = field( + metadata={"component": "primary"}, converter=components.ColorArray.from_similar, # type: ignore[misc] ) """ @@ -60,18 +58,16 @@ class Points2D(Archetype): As either 0-1 floats or 0-255 integers, with separate alpha. """ - labels: components.LabelArray | None = field( - metadata={"component": "secondary"}, - default=None, + labels: components.LabelArray = field( + metadata={"component": "primary"}, converter=components.LabelArray.from_similar, # type: ignore[misc] ) """ Optional text labels for the points. """ - draw_order: components.DrawOrderArray | None = field( - metadata={"component": "secondary"}, - default=None, + draw_order: components.DrawOrderArray = field( + metadata={"component": "primary"}, converter=components.DrawOrderArray.from_similar, # type: ignore[misc] ) """ @@ -81,9 +77,8 @@ class Points2D(Archetype): The default for 2D points is 30.0. """ - class_ids: components.ClassIdArray | None = field( - metadata={"component": "secondary"}, - default=None, + class_ids: components.ClassIdArray = field( + metadata={"component": "primary"}, converter=components.ClassIdArray.from_similar, # type: ignore[misc] ) """ @@ -92,9 +87,8 @@ class Points2D(Archetype): The class ID provides colors and labels if not specified explicitly. """ - keypoint_ids: components.KeypointIdArray | None = field( - metadata={"component": "secondary"}, - default=None, + keypoint_ids: components.KeypointIdArray = field( + metadata={"component": "primary"}, converter=components.KeypointIdArray.from_similar, # type: ignore[misc] ) """ @@ -108,9 +102,8 @@ class Points2D(Archetype): detected skeleton. """ - instance_keys: components.InstanceKeyArray | None = field( - metadata={"component": "secondary"}, - default=None, + instance_keys: components.InstanceKeyArray = field( + metadata={"component": "primary"}, converter=components.InstanceKeyArray.from_similar, # type: ignore[misc] ) """ diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py index 2ba67c186a25..eea3d32730bc 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py @@ -175,7 +175,7 @@ class AffixFuzzer6Array(BaseDelegatingExtensionArray[datatypes.AffixFuzzer1Array @define class AffixFuzzer7: - many_optional: list[datatypes.AffixFuzzer1] | None = field(default=None) + many_optional: list[datatypes.AffixFuzzer1] = field() AffixFuzzer7Like = AffixFuzzer7 @@ -197,28 +197,28 @@ def __init__(self) -> None: "item", pa.struct( [ - pa.field("single_float_optional", pa.float32(), True, {}), + pa.field("single_float_optional", pa.float32(), False, {}), pa.field("single_string_required", pa.utf8(), False, {}), - pa.field("single_string_optional", pa.utf8(), True, {}), + pa.field("single_string_optional", pa.utf8(), False, {}), pa.field( - "many_floats_optional", pa.list_(pa.field("item", pa.float32(), True, {})), True, {} + "many_floats_optional", pa.list_(pa.field("item", pa.float32(), False, {})), False, {} ), pa.field( "many_strings_required", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {} ), pa.field( - "many_strings_optional", pa.list_(pa.field("item", pa.utf8(), True, {})), True, {} + "many_strings_optional", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {} ), pa.field("flattened_scalar", pa.float32(), False, {}), pa.field( "almost_flattened_scalar", - pa.struct([pa.field("value", pa.float32(), True, {})]), + pa.struct([pa.field("value", pa.float32(), False, {})]), False, {}, ), ] ), - True, + False, {}, ) ), @@ -243,11 +243,14 @@ def _native_to_pa_array(data: AffixFuzzer7ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer8: - single_float_optional: float | None = field(default=None) + single_float_optional: float = field() def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.single_float_optional, dtype=dtype) + def __float__(self) -> float: + return float(self.single_float_optional) + AffixFuzzer8Like = AffixFuzzer8 AffixFuzzer8ArrayLike = Union[ @@ -319,7 +322,10 @@ def _native_to_pa_array(data: AffixFuzzer9ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer10: - single_string_optional: str | None = field(default=None) + single_string_optional: str = field() + + def __str__(self) -> str: + return str(self.single_string_optional) AffixFuzzer10Like = AffixFuzzer10 @@ -354,7 +360,7 @@ def _native_to_pa_array(data: AffixFuzzer10ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer11: - many_floats_optional: npt.NDArray[np.float32] | None = field(default=None, converter=to_np_float32) + many_floats_optional: npt.NDArray[np.float32] = field(converter=to_np_float32) def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.many_floats_optional, dtype=dtype) @@ -373,7 +379,7 @@ def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: class AffixFuzzer11Type(BaseExtensionType): def __init__(self) -> None: pa.ExtensionType.__init__( - self, pa.list_(pa.field("item", pa.float32(), True, {})), "rerun.testing.components.AffixFuzzer11" + self, pa.list_(pa.field("item", pa.float32(), False, {})), "rerun.testing.components.AffixFuzzer11" ) @@ -431,7 +437,7 @@ def _native_to_pa_array(data: AffixFuzzer12ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer13: - many_strings_optional: list[str] | None = field(default=None) + many_strings_optional: list[str] = field() AffixFuzzer13Like = AffixFuzzer13 @@ -447,7 +453,7 @@ class AffixFuzzer13: class AffixFuzzer13Type(BaseExtensionType): def __init__(self) -> None: pa.ExtensionType.__init__( - self, pa.list_(pa.field("item", pa.utf8(), True, {})), "rerun.testing.components.AffixFuzzer13" + self, pa.list_(pa.field("item", pa.utf8(), False, {})), "rerun.testing.components.AffixFuzzer13" ) diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py index 88c3b03e587e..baf211917924 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py @@ -39,11 +39,14 @@ @define class FlattenedScalar: - value: float | None = field(default=None) + value: float = field() def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.value, dtype=dtype) + def __float__(self) -> float: + return float(self.value) + FlattenedScalarLike = FlattenedScalar FlattenedScalarArrayLike = Union[ @@ -58,7 +61,7 @@ def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: class FlattenedScalarType(BaseExtensionType): def __init__(self) -> None: pa.ExtensionType.__init__( - self, pa.struct([pa.field("value", pa.float32(), True, {})]), "rerun.testing.datatypes.FlattenedScalar" + self, pa.struct([pa.field("value", pa.float32(), False, {})]), "rerun.testing.datatypes.FlattenedScalar" ) @@ -79,14 +82,14 @@ def _native_to_pa_array(data: FlattenedScalarArrayLike, data_type: pa.DataType) @define class AffixFuzzer1: + single_float_optional: float = field() single_string_required: str = field() + single_string_optional: str = field() + many_floats_optional: npt.NDArray[np.float32] = field(converter=to_np_float32) many_strings_required: list[str] = field() + many_strings_optional: list[str] = field() flattened_scalar: float = field() almost_flattened_scalar: datatypes.FlattenedScalar = field() - single_float_optional: float | None = field(default=None) - single_string_optional: str | None = field(default=None) - many_floats_optional: npt.NDArray[np.float32] | None = field(default=None, converter=to_np_float32) - many_strings_optional: list[str] | None = field(default=None) AffixFuzzer1Like = AffixFuzzer1 @@ -105,15 +108,15 @@ def __init__(self) -> None: self, pa.struct( [ - pa.field("single_float_optional", pa.float32(), True, {}), + pa.field("single_float_optional", pa.float32(), False, {}), pa.field("single_string_required", pa.utf8(), False, {}), - pa.field("single_string_optional", pa.utf8(), True, {}), - pa.field("many_floats_optional", pa.list_(pa.field("item", pa.float32(), True, {})), True, {}), + pa.field("single_string_optional", pa.utf8(), False, {}), + pa.field("many_floats_optional", pa.list_(pa.field("item", pa.float32(), False, {})), False, {}), pa.field("many_strings_required", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {}), - pa.field("many_strings_optional", pa.list_(pa.field("item", pa.utf8(), True, {})), True, {}), + pa.field("many_strings_optional", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {}), pa.field("flattened_scalar", pa.float32(), False, {}), pa.field( - "almost_flattened_scalar", pa.struct([pa.field("value", pa.float32(), True, {})]), False, {} + "almost_flattened_scalar", pa.struct([pa.field("value", pa.float32(), False, {})]), False, {} ), ] ), @@ -138,11 +141,14 @@ def _native_to_pa_array(data: AffixFuzzer1ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer2: - single_float_optional: float | None = field(default=None) + single_float_optional: float = field() def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.single_float_optional, dtype=dtype) + def __float__(self) -> float: + return float(self.single_float_optional) + AffixFuzzer2Like = AffixFuzzer2 AffixFuzzer2ArrayLike = Union[ From 20ab78829d3b948a7bf372c7ecfc2de322134d6d Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 6 Jul 2023 13:15:06 +0200 Subject: [PATCH 2/4] update definitions with new attr --- .../definitions/rerun/archetypes/points2d.fbs | 16 +-- .../definitions/rerun/components/label.fbs | 2 +- .../rerun/testing/archetypes/fuzzy.fbs | 104 +++++++++--------- .../rerun/testing/components/fuzzy.fbs | 26 ++--- .../rerun/testing/datatypes/fuzzy.fbs | 18 +-- 5 files changed, 83 insertions(+), 83 deletions(-) diff --git a/crates/re_types/definitions/rerun/archetypes/points2d.fbs b/crates/re_types/definitions/rerun/archetypes/points2d.fbs index d16250144acd..6ae27c22fa1d 100644 --- a/crates/re_types/definitions/rerun/archetypes/points2d.fbs +++ b/crates/re_types/definitions/rerun/archetypes/points2d.fbs @@ -34,34 +34,34 @@ table Points2D ( // --- Required --- /// All the actual 2D points that make up the point cloud. - points: [rerun.components.Point2D] ("attr.rerun.component_required", required, order: 1000); + points: [rerun.components.Point2D] ("attr.rerun.component_required", order: 1000); // --- Recommended --- /// Optional radii for the points, effectively turning them into circles. - radii: [rerun.components.Radius] ("attr.rerun.component_recommended", order: 2000); + radii: [rerun.components.Radius] ("attr.rerun.component_recommended", is_nullable, order: 2000); /// Optional colors for the points. /// /// \python The colors are interpreted as RGB or RGBA in sRGB gamma-space, /// \python As either 0-1 floats or 0-255 integers, with separate alpha. - colors: [rerun.components.Color] ("attr.rerun.component_recommended", order: 2100); + colors: [rerun.components.Color] ("attr.rerun.component_recommended", is_nullable, order: 2100); // --- Optional --- /// Optional text labels for the points. - labels: [rerun.components.Label] ("attr.rerun.component_optional", order: 3000); + labels: [rerun.components.Label] ("attr.rerun.component_optional", is_nullable, order: 3000); /// An optional floating point value that specifies the 2D drawing order. /// Objects with higher values are drawn on top of those with lower values. /// /// The default for 2D points is 30.0. - draw_order: rerun.components.DrawOrder ("attr.rerun.component_optional", order: 3100); + draw_order: rerun.components.DrawOrder ("attr.rerun.component_optional", is_nullable, order: 3100); /// Optional class Ids for the points. /// /// The class ID provides colors and labels if not specified explicitly. - class_ids: [rerun.components.ClassId] ("attr.rerun.component_optional", order: 3200); + class_ids: [rerun.components.ClassId] ("attr.rerun.component_optional", is_nullable, order: 3200); /// Optional keypoint IDs for the points, identifying them within a class. /// @@ -71,8 +71,8 @@ table Points2D ( /// with `class_id`). /// E.g. the classification might be 'Person' and the keypoints refer to joints on a /// detected skeleton. - keypoint_ids: [rerun.components.KeypointId] ("attr.rerun.component_optional", order: 3300); + keypoint_ids: [rerun.components.KeypointId] ("attr.rerun.component_optional", is_nullable, order: 3300); /// Unique identifiers for each individual point in the batch. - instance_keys: [rerun.components.InstanceKey] ("attr.rerun.component_optional", order: 3400); + instance_keys: [rerun.components.InstanceKey] ("attr.rerun.component_optional", is_nullable, order: 3400); } diff --git a/crates/re_types/definitions/rerun/components/label.fbs b/crates/re_types/definitions/rerun/components/label.fbs index e0c4497264a0..f8de710a7157 100644 --- a/crates/re_types/definitions/rerun/components/label.fbs +++ b/crates/re_types/definitions/rerun/components/label.fbs @@ -19,5 +19,5 @@ table Label ( "attr.rust.tuple_struct", order: 100 ) { - value: string (required, order: 100); + value: string (order: 100); } diff --git a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs index 913ff36b497c..812e3606cc4e 100644 --- a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs @@ -15,60 +15,60 @@ table AffixFuzzer1 ( "attr.rust.derive": "PartialEq", order: 100 ) { - fuzz1001: rerun.testing.components.AffixFuzzer1 ("attr.rerun.component_required", required, order: 1001); - fuzz1002: rerun.testing.components.AffixFuzzer2 ("attr.rerun.component_required", required, order: 1002); - fuzz1003: rerun.testing.components.AffixFuzzer3 ("attr.rerun.component_required", required, order: 1003); - fuzz1004: rerun.testing.components.AffixFuzzer4 ("attr.rerun.component_required", required, order: 1004); - fuzz1005: rerun.testing.components.AffixFuzzer5 ("attr.rerun.component_required", required, order: 1005); - fuzz1006: rerun.testing.components.AffixFuzzer6 ("attr.rerun.component_required", required, order: 1006); - fuzz1007: rerun.testing.components.AffixFuzzer7 ("attr.rerun.component_required", required, order: 1007); - fuzz1008: rerun.testing.components.AffixFuzzer8 ("attr.rerun.component_required", required, order: 1008); - fuzz1009: rerun.testing.components.AffixFuzzer9 ("attr.rerun.component_required", required, order: 1009); - fuzz1010: rerun.testing.components.AffixFuzzer10 ("attr.rerun.component_required", required, order: 1010); - fuzz1011: rerun.testing.components.AffixFuzzer11 ("attr.rerun.component_required", required, order: 1011); - fuzz1012: rerun.testing.components.AffixFuzzer12 ("attr.rerun.component_required", required, order: 1012); - fuzz1013: rerun.testing.components.AffixFuzzer13 ("attr.rerun.component_required", required, order: 1013); + fuzz1001: rerun.testing.components.AffixFuzzer1 ("attr.rerun.component_required", order: 1001); + fuzz1002: rerun.testing.components.AffixFuzzer2 ("attr.rerun.component_required", order: 1002); + fuzz1003: rerun.testing.components.AffixFuzzer3 ("attr.rerun.component_required", order: 1003); + fuzz1004: rerun.testing.components.AffixFuzzer4 ("attr.rerun.component_required", order: 1004); + fuzz1005: rerun.testing.components.AffixFuzzer5 ("attr.rerun.component_required", order: 1005); + fuzz1006: rerun.testing.components.AffixFuzzer6 ("attr.rerun.component_required", order: 1006); + fuzz1007: rerun.testing.components.AffixFuzzer7 ("attr.rerun.component_required", order: 1007); + fuzz1008: rerun.testing.components.AffixFuzzer8 ("attr.rerun.component_required", order: 1008); + fuzz1009: rerun.testing.components.AffixFuzzer9 ("attr.rerun.component_required", order: 1009); + fuzz1010: rerun.testing.components.AffixFuzzer10 ("attr.rerun.component_required", order: 1010); + fuzz1011: rerun.testing.components.AffixFuzzer11 ("attr.rerun.component_required", order: 1011); + fuzz1012: rerun.testing.components.AffixFuzzer12 ("attr.rerun.component_required", order: 1012); + fuzz1013: rerun.testing.components.AffixFuzzer13 ("attr.rerun.component_required", order: 1013); - fuzz1101: [rerun.testing.components.AffixFuzzer1] ("attr.rerun.component_required", required, order: 1101); - fuzz1102: [rerun.testing.components.AffixFuzzer2] ("attr.rerun.component_required", required, order: 1102); - fuzz1103: [rerun.testing.components.AffixFuzzer3] ("attr.rerun.component_required", required, order: 1103); - fuzz1104: [rerun.testing.components.AffixFuzzer4] ("attr.rerun.component_required", required, order: 1104); - fuzz1105: [rerun.testing.components.AffixFuzzer5] ("attr.rerun.component_required", required, order: 1105); - fuzz1106: [rerun.testing.components.AffixFuzzer6] ("attr.rerun.component_required", required, order: 1106); - fuzz1107: [rerun.testing.components.AffixFuzzer7] ("attr.rerun.component_required", required, order: 1107); - fuzz1108: [rerun.testing.components.AffixFuzzer8] ("attr.rerun.component_required", required, order: 1108); - fuzz1109: [rerun.testing.components.AffixFuzzer9] ("attr.rerun.component_required", required, order: 1109); - fuzz1110: [rerun.testing.components.AffixFuzzer10] ("attr.rerun.component_required", required, order: 1110); - fuzz1111: [rerun.testing.components.AffixFuzzer11] ("attr.rerun.component_required", required, order: 1111); - fuzz1112: [rerun.testing.components.AffixFuzzer12] ("attr.rerun.component_required", required, order: 1112); - fuzz1113: [rerun.testing.components.AffixFuzzer13] ("attr.rerun.component_required", required, order: 1113); + fuzz1101: [rerun.testing.components.AffixFuzzer1] ("attr.rerun.component_required", order: 1101); + fuzz1102: [rerun.testing.components.AffixFuzzer2] ("attr.rerun.component_required", order: 1102); + fuzz1103: [rerun.testing.components.AffixFuzzer3] ("attr.rerun.component_required", order: 1103); + fuzz1104: [rerun.testing.components.AffixFuzzer4] ("attr.rerun.component_required", order: 1104); + fuzz1105: [rerun.testing.components.AffixFuzzer5] ("attr.rerun.component_required", order: 1105); + fuzz1106: [rerun.testing.components.AffixFuzzer6] ("attr.rerun.component_required", order: 1106); + fuzz1107: [rerun.testing.components.AffixFuzzer7] ("attr.rerun.component_required", order: 1107); + fuzz1108: [rerun.testing.components.AffixFuzzer8] ("attr.rerun.component_required", order: 1108); + fuzz1109: [rerun.testing.components.AffixFuzzer9] ("attr.rerun.component_required", order: 1109); + fuzz1110: [rerun.testing.components.AffixFuzzer10] ("attr.rerun.component_required", order: 1110); + fuzz1111: [rerun.testing.components.AffixFuzzer11] ("attr.rerun.component_required", order: 1111); + fuzz1112: [rerun.testing.components.AffixFuzzer12] ("attr.rerun.component_required", order: 1112); + fuzz1113: [rerun.testing.components.AffixFuzzer13] ("attr.rerun.component_required", order: 1113); - fuzz2001: rerun.testing.components.AffixFuzzer1 ("attr.rerun.component_optional", order: 2001); - fuzz2002: rerun.testing.components.AffixFuzzer2 ("attr.rerun.component_optional", order: 2002); - fuzz2003: rerun.testing.components.AffixFuzzer3 ("attr.rerun.component_optional", order: 2003); - fuzz2004: rerun.testing.components.AffixFuzzer4 ("attr.rerun.component_optional", order: 2004); - fuzz2005: rerun.testing.components.AffixFuzzer5 ("attr.rerun.component_optional", order: 2005); - fuzz2006: rerun.testing.components.AffixFuzzer6 ("attr.rerun.component_optional", order: 2006); - fuzz2007: rerun.testing.components.AffixFuzzer7 ("attr.rerun.component_optional", order: 2007); - fuzz2008: rerun.testing.components.AffixFuzzer8 ("attr.rerun.component_optional", order: 2008); - fuzz2009: rerun.testing.components.AffixFuzzer9 ("attr.rerun.component_optional", order: 2009); - fuzz2010: rerun.testing.components.AffixFuzzer10 ("attr.rerun.component_optional", order: 2010); - fuzz2011: rerun.testing.components.AffixFuzzer11 ("attr.rerun.component_optional", order: 2011); - fuzz2012: rerun.testing.components.AffixFuzzer12 ("attr.rerun.component_optional", order: 2012); - fuzz2013: rerun.testing.components.AffixFuzzer13 ("attr.rerun.component_optional", order: 2013); + fuzz2001: rerun.testing.components.AffixFuzzer1 ("attr.rerun.component_optional", is_nullable, order: 2001); + fuzz2002: rerun.testing.components.AffixFuzzer2 ("attr.rerun.component_optional", is_nullable, order: 2002); + fuzz2003: rerun.testing.components.AffixFuzzer3 ("attr.rerun.component_optional", is_nullable, order: 2003); + fuzz2004: rerun.testing.components.AffixFuzzer4 ("attr.rerun.component_optional", is_nullable, order: 2004); + fuzz2005: rerun.testing.components.AffixFuzzer5 ("attr.rerun.component_optional", is_nullable, order: 2005); + fuzz2006: rerun.testing.components.AffixFuzzer6 ("attr.rerun.component_optional", is_nullable, order: 2006); + fuzz2007: rerun.testing.components.AffixFuzzer7 ("attr.rerun.component_optional", is_nullable, order: 2007); + fuzz2008: rerun.testing.components.AffixFuzzer8 ("attr.rerun.component_optional", is_nullable, order: 2008); + fuzz2009: rerun.testing.components.AffixFuzzer9 ("attr.rerun.component_optional", is_nullable, order: 2009); + fuzz2010: rerun.testing.components.AffixFuzzer10 ("attr.rerun.component_optional", is_nullable, order: 2010); + fuzz2011: rerun.testing.components.AffixFuzzer11 ("attr.rerun.component_optional", is_nullable, order: 2011); + fuzz2012: rerun.testing.components.AffixFuzzer12 ("attr.rerun.component_optional", is_nullable, order: 2012); + fuzz2013: rerun.testing.components.AffixFuzzer13 ("attr.rerun.component_optional", is_nullable, order: 2013); - fuzz2101: [rerun.testing.components.AffixFuzzer1] ("attr.rerun.component_optional", order: 2101); - fuzz2102: [rerun.testing.components.AffixFuzzer2] ("attr.rerun.component_optional", order: 2102); - fuzz2103: [rerun.testing.components.AffixFuzzer3] ("attr.rerun.component_optional", order: 2103); - fuzz2104: [rerun.testing.components.AffixFuzzer4] ("attr.rerun.component_optional", order: 2104); - fuzz2105: [rerun.testing.components.AffixFuzzer5] ("attr.rerun.component_optional", order: 2105); - fuzz2106: [rerun.testing.components.AffixFuzzer6] ("attr.rerun.component_optional", order: 2106); - fuzz2107: [rerun.testing.components.AffixFuzzer7] ("attr.rerun.component_optional", order: 2107); - fuzz2108: [rerun.testing.components.AffixFuzzer8] ("attr.rerun.component_optional", order: 2108); - fuzz2109: [rerun.testing.components.AffixFuzzer9] ("attr.rerun.component_optional", order: 2109); - fuzz2110: [rerun.testing.components.AffixFuzzer10] ("attr.rerun.component_optional", order: 2110); - fuzz2111: [rerun.testing.components.AffixFuzzer11] ("attr.rerun.component_optional", order: 2111); - fuzz2112: [rerun.testing.components.AffixFuzzer12] ("attr.rerun.component_optional", order: 2112); - fuzz2113: [rerun.testing.components.AffixFuzzer13] ("attr.rerun.component_optional", order: 2113); + fuzz2101: [rerun.testing.components.AffixFuzzer1] ("attr.rerun.component_optional", is_nullable, order: 2101); + fuzz2102: [rerun.testing.components.AffixFuzzer2] ("attr.rerun.component_optional", is_nullable, order: 2102); + fuzz2103: [rerun.testing.components.AffixFuzzer3] ("attr.rerun.component_optional", is_nullable, order: 2103); + fuzz2104: [rerun.testing.components.AffixFuzzer4] ("attr.rerun.component_optional", is_nullable, order: 2104); + fuzz2105: [rerun.testing.components.AffixFuzzer5] ("attr.rerun.component_optional", is_nullable, order: 2105); + fuzz2106: [rerun.testing.components.AffixFuzzer6] ("attr.rerun.component_optional", is_nullable, order: 2106); + fuzz2107: [rerun.testing.components.AffixFuzzer7] ("attr.rerun.component_optional", is_nullable, order: 2107); + fuzz2108: [rerun.testing.components.AffixFuzzer8] ("attr.rerun.component_optional", is_nullable, order: 2108); + fuzz2109: [rerun.testing.components.AffixFuzzer9] ("attr.rerun.component_optional", is_nullable, order: 2109); + fuzz2110: [rerun.testing.components.AffixFuzzer10] ("attr.rerun.component_optional", is_nullable, order: 2110); + fuzz2111: [rerun.testing.components.AffixFuzzer11] ("attr.rerun.component_optional", is_nullable, order: 2111); + fuzz2112: [rerun.testing.components.AffixFuzzer12] ("attr.rerun.component_optional", is_nullable, order: 2112); + fuzz2113: [rerun.testing.components.AffixFuzzer13] ("attr.rerun.component_optional", is_nullable, order: 2113); } diff --git a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs index da39e113548a..ce7aee765e2d 100644 --- a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs @@ -12,7 +12,7 @@ table AffixFuzzer1 ( "attr.rust.derive": "PartialEq", order: 100 ) { - single_required: rerun.testing.datatypes.AffixFuzzer1 (required, order: 101); + single_required: rerun.testing.datatypes.AffixFuzzer1 (order: 101); } table AffixFuzzer2 ( @@ -20,21 +20,21 @@ table AffixFuzzer2 ( "attr.rust.tuple_struct", order: 200 ) { - single_required: rerun.testing.datatypes.AffixFuzzer1 (required, order: 102); + single_required: rerun.testing.datatypes.AffixFuzzer1 (order: 102); } table AffixFuzzer3 ( "attr.rust.derive": "PartialEq", order: 300 ) { - single_required: rerun.testing.datatypes.AffixFuzzer1 (required, order: 103); + single_required: rerun.testing.datatypes.AffixFuzzer1 (order: 103); } table AffixFuzzer4 ( "attr.rust.derive": "PartialEq", order: 400 ) { - single_optional: rerun.testing.datatypes.AffixFuzzer1 (order: 104); + single_optional: rerun.testing.datatypes.AffixFuzzer1 (is_nullable, order: 104); } table AffixFuzzer5 ( @@ -42,63 +42,63 @@ table AffixFuzzer5 ( "attr.rust.tuple_struct", order: 500 ) { - single_optional: rerun.testing.datatypes.AffixFuzzer1 (order: 105); + single_optional: rerun.testing.datatypes.AffixFuzzer1 (is_nullable, order: 105); } table AffixFuzzer6 ( "attr.rust.derive": "PartialEq", order: 600 ) { - single_optional: rerun.testing.datatypes.AffixFuzzer1 (order: 106); + single_optional: rerun.testing.datatypes.AffixFuzzer1 (is_nullable, order: 106); } table AffixFuzzer7 ( "attr.rust.derive": "PartialEq", order: 700 ) { - many_optional: [rerun.testing.datatypes.AffixFuzzer1] (order: 107); + many_optional: [rerun.testing.datatypes.AffixFuzzer1] (is_nullable, order: 107); } table AffixFuzzer8 ( "attr.rust.derive": "PartialEq", order: 800 ) { - single_float_optional: float (order: 108); + single_float_optional: float (is_nullable, order: 108); } table AffixFuzzer9 ( "attr.rust.derive": "PartialEq, Eq", order: 900 ) { - single_string_required: string (required, order: 109); + single_string_required: string (order: 109); } table AffixFuzzer10 ( "attr.rust.derive": "PartialEq, Eq", order: 1000 ) { - single_string_optional: string (order: 110); + single_string_optional: string (is_nullable, order: 110); } table AffixFuzzer11 ( "attr.rust.derive": "PartialEq", order: 1100 ) { - many_floats_optional: [float] (order: 111); + many_floats_optional: [float] (is_nullable, order: 111); } table AffixFuzzer12 ( "attr.rust.derive": "PartialEq, Eq", order: 1200 ) { - many_strings_required: [string] (required, order: 112); + many_strings_required: [string] (order: 112); } table AffixFuzzer13 ( "attr.rust.derive": "PartialEq, Eq", order: 1300 ) { - many_strings_optional: [string] (order: 113); + many_strings_optional: [string] (is_nullable, order: 113); } // TODO(cmc): the ugly bug we need to take care of at some point diff --git a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs index 3671982ecbfd..c075a61fee33 100644 --- a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs @@ -26,14 +26,14 @@ table AffixFuzzer1 ( "attr.rust.derive": "PartialEq", order: 100 ) { - single_float_optional: float (order: 101); - single_string_required: string (order: 102, required); - single_string_optional: string (order: 103); - many_floats_optional: [float] (order: 104); - many_strings_required: [string] (order: 105, required); - many_strings_optional: [string] (order: 106); - flattened_scalar: VeryDeeplyFlattenedScalar (order: 107, required, transparent); - almost_flattened_scalar: SurprisinglyShallowScalar (order: 108, required, transparent); + single_float_optional: float (is_nullable, order: 101); + single_string_required: string (order: 102); + single_string_optional: string (is_nullable, order: 103); + many_floats_optional: [float] (is_nullable, order: 104); + many_strings_required: [string] (order: 105); + many_strings_optional: [string] (is_nullable, order: 106); + flattened_scalar: VeryDeeplyFlattenedScalar (order: 107, transparent); + almost_flattened_scalar: SurprisinglyShallowScalar (order: 108, transparent); } table AffixFuzzer2 ( @@ -42,5 +42,5 @@ table AffixFuzzer2 ( "attr.rust.tuple_struct", order: 200 ) { - single_float_optional: float (order: 101); + single_float_optional: float (is_nullable, order: 101); } From 8930c595ea7f3c24957f39131fe5962b9fdf4c79 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 6 Jul 2023 13:15:17 +0200 Subject: [PATCH 3/4] codegen --- crates/re_types/source_hash.txt | 2 +- crates/re_types/src/archetypes/fuzzy.rs | 2146 +++++++++-------- crates/re_types/src/archetypes/points2d.rs | 479 ++-- crates/re_types/src/components/fuzzy.rs | 280 +-- crates/re_types/src/datatypes/fuzzy.rs | 134 +- crates/re_types/tests/fuzzy.rs | 10 +- .../rerun/_rerun2/archetypes/fuzzy.py | 130 +- .../rerun/_rerun2/archetypes/points2d.py | 35 +- .../rerun/_rerun2/components/fuzzy.py | 30 +- .../rerun/_rerun2/datatypes/fuzzy.py | 21 +- 10 files changed, 1733 insertions(+), 1534 deletions(-) diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index da0ae72b7c4d..110c8e2e9d47 100644 --- a/crates/re_types/source_hash.txt +++ b/crates/re_types/source_hash.txt @@ -1,4 +1,4 @@ # This is a sha256 hash for all direct and indirect dependencies of this crate's build script. # It can be safely removed at anytime to force the build script to run again. # Check out build.rs to see how it's computed. -b082d754a07a09876359fde690a979681127e0ea911d213c4aaaa70aa47f4f2b \ No newline at end of file +e2fe09d197c4d6639e8e0025f54510043f32bc4c269bcb772f9196027de1ff8e \ No newline at end of file diff --git a/crates/re_types/src/archetypes/fuzzy.rs b/crates/re_types/src/archetypes/fuzzy.rs index 29b9f74041a3..22609bed9f1b 100644 --- a/crates/re_types/src/archetypes/fuzzy.rs +++ b/crates/re_types/src/archetypes/fuzzy.rs @@ -37,32 +37,32 @@ pub struct AffixFuzzer1 { pub fuzz1111: Vec, pub fuzz1112: Vec, pub fuzz1113: Vec, - pub fuzz2001: crate::components::AffixFuzzer1, - pub fuzz2002: crate::components::AffixFuzzer2, - pub fuzz2003: crate::components::AffixFuzzer3, - pub fuzz2004: crate::components::AffixFuzzer4, - pub fuzz2005: crate::components::AffixFuzzer5, - pub fuzz2006: crate::components::AffixFuzzer6, - pub fuzz2007: crate::components::AffixFuzzer7, - pub fuzz2008: crate::components::AffixFuzzer8, - pub fuzz2009: crate::components::AffixFuzzer9, - pub fuzz2010: crate::components::AffixFuzzer10, - pub fuzz2011: crate::components::AffixFuzzer11, - pub fuzz2012: crate::components::AffixFuzzer12, - pub fuzz2013: crate::components::AffixFuzzer13, - pub fuzz2101: Vec, - pub fuzz2102: Vec, - pub fuzz2103: Vec, - pub fuzz2104: Vec, - pub fuzz2105: Vec, - pub fuzz2106: Vec, - pub fuzz2107: Vec, - pub fuzz2108: Vec, - pub fuzz2109: Vec, - pub fuzz2110: Vec, - pub fuzz2111: Vec, - pub fuzz2112: Vec, - pub fuzz2113: Vec, + pub fuzz2001: Option, + pub fuzz2002: Option, + pub fuzz2003: Option, + pub fuzz2004: Option, + pub fuzz2005: Option, + pub fuzz2006: Option, + pub fuzz2007: Option, + pub fuzz2008: Option, + pub fuzz2009: Option, + pub fuzz2010: Option, + pub fuzz2011: Option, + pub fuzz2012: Option, + pub fuzz2013: Option, + pub fuzz2101: Option>, + pub fuzz2102: Option>, + pub fuzz2103: Option>, + pub fuzz2104: Option>, + pub fuzz2105: Option>, + pub fuzz2106: Option>, + pub fuzz2107: Option>, + pub fuzz2108: Option>, + pub fuzz2109: Option>, + pub fuzz2110: Option>, + pub fuzz2111: Option>, + pub fuzz2112: Option>, + pub fuzz2113: Option>, } impl AffixFuzzer1 { @@ -688,875 +688,533 @@ impl crate::Archetype for AffixFuzzer1 { .transpose()? }, { - Some({ - let array = - ::try_to_arrow([&self.fuzz2001], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer1".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer1".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2001", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2002], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer2".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer2".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2002", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2003], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer3".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer3".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2003", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2004], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer4".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer4".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2004", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2005], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer5".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer5".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2005", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2006], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer6".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer6".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2006", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2007], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer7".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer7".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2007", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2008], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer8".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer8".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2008", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2009], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer9".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer9".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2009", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2010], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer10".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer10".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2010", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2011], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer11".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer11".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2011", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2012], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer12".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer12".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2012", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow([&self.fuzz2013], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer13".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer13".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2013", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2101.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer1".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer1".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2101", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2102.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer2".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer2".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2102", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2103.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer3".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer3".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2103", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2104.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer4".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer4".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2104", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2105.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer5".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer5".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2105", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2106.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer6".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer6".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2106", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2107.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer7".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer7".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2107", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2108.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer8".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer8".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2108", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = - ::try_to_arrow(self.fuzz2109.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer9".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer9".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2109", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = ::try_to_arrow( - self.fuzz2110.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer10".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer10".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2110", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = ::try_to_arrow( - self.fuzz2111.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer11".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer11".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2111", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = ::try_to_arrow( - self.fuzz2112.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer12".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer12".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2112", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - { - Some({ - let array = ::try_to_arrow( - self.fuzz2113.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.testing.components.AffixFuzzer13".into(), - Box::new(array.data_type().clone()), - Some("rerun.testing.components.AffixFuzzer13".into()), - ); - ( - ::arrow2::datatypes::Field::new("fuzz2113", datatype, false), - array, - ) - }) - }) - .transpose()? - }, - ] - .into_iter() - .flatten() - .collect()) - } - - #[inline] - fn try_from_arrow( - data: impl IntoIterator)>, - ) -> crate::DeserializationResult { - use crate::Component as _; - let arrays_by_name: ::std::collections::HashMap<_, _> = data - .into_iter() - .map(|(field, array)| (field.name, array)) - .collect(); - let fuzz1001 = { - let array = arrays_by_name.get("fuzz1001").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1002 = { - let array = arrays_by_name.get("fuzz1002").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1003 = { - let array = arrays_by_name.get("fuzz1003").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1004 = { - let array = arrays_by_name.get("fuzz1004").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1005 = { - let array = arrays_by_name.get("fuzz1005").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1006 = { - let array = arrays_by_name.get("fuzz1006").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1007 = { - let array = arrays_by_name.get("fuzz1007").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1008 = { - let array = arrays_by_name.get("fuzz1008").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1009 = { - let array = arrays_by_name.get("fuzz1009").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1010 = { - let array = arrays_by_name.get("fuzz1010").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1011 = { - let array = arrays_by_name.get("fuzz1011").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1012 = { - let array = arrays_by_name.get("fuzz1012").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1013 = { - let array = arrays_by_name.get("fuzz1013").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let fuzz1101 = { - let array = arrays_by_name.get("fuzz1101").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1102 = { - let array = arrays_by_name.get("fuzz1102").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1103 = { - let array = arrays_by_name.get("fuzz1103").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1104 = { - let array = arrays_by_name.get("fuzz1104").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1105 = { - let array = arrays_by_name.get("fuzz1105").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1106 = { - let array = arrays_by_name.get("fuzz1106").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1107 = { - let array = arrays_by_name.get("fuzz1107").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1108 = { - let array = arrays_by_name.get("fuzz1108").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1109 = { - let array = arrays_by_name.get("fuzz1109").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1110 = { - let array = arrays_by_name.get("fuzz1110").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1111 = { - let array = arrays_by_name.get("fuzz1111").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1112 = { - let array = arrays_by_name.get("fuzz1112").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz1113 = { - let array = arrays_by_name.get("fuzz1113").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - }) - }) - .collect::>>()? - }; - let fuzz2001 = { - let array = arrays_by_name.get("fuzz2001").ok_or_else(|| { + self.fuzz2001 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer1".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer1".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2001", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2002 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer2".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer2".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2002", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2003 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer3".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer3".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2003", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2004 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer4".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer4".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2004", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2005 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer5".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer5".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2005", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2006 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer6".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer6".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2006", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2007 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer7".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer7".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2007", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2008 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer8".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer8".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2008", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2009 + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer9".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer9".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2009", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2010 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer10".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer10".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2010", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2011 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer11".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer11".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2011", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2012 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer12".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer12".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2012", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2013 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer13".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer13".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2013", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2101 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer1".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer1".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2101", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2102 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer2".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer2".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2102", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2103 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer3".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer3".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2103", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2104 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer4".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer4".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2104", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2105 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer5".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer5".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2105", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2106 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer6".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer6".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2106", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2107 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer7".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer7".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2107", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2108 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer8".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer8".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2108", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2109 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer9".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer9".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2109", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2110 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer10".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer10".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2110", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2111 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer11".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer11".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2111", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2112 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer12".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer12".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2112", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2113 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer13".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer13".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2113", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + ] + .into_iter() + .flatten() + .collect()) + } + + #[inline] + fn try_from_arrow( + data: impl IntoIterator)>, + ) -> crate::DeserializationResult { + use crate::Component as _; + let arrays_by_name: ::std::collections::HashMap<_, _> = data + .into_iter() + .map(|(field, array)| (field.name, array)) + .collect(); + let fuzz1001 = { + let array = arrays_by_name.get("fuzz1001").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1569,8 +1227,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2002 = { - let array = arrays_by_name.get("fuzz2002").ok_or_else(|| { + let fuzz1002 = { + let array = arrays_by_name.get("fuzz1002").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1583,8 +1241,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2003 = { - let array = arrays_by_name.get("fuzz2003").ok_or_else(|| { + let fuzz1003 = { + let array = arrays_by_name.get("fuzz1003").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1597,8 +1255,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2004 = { - let array = arrays_by_name.get("fuzz2004").ok_or_else(|| { + let fuzz1004 = { + let array = arrays_by_name.get("fuzz1004").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1611,8 +1269,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2005 = { - let array = arrays_by_name.get("fuzz2005").ok_or_else(|| { + let fuzz1005 = { + let array = arrays_by_name.get("fuzz1005").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1625,8 +1283,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2006 = { - let array = arrays_by_name.get("fuzz2006").ok_or_else(|| { + let fuzz1006 = { + let array = arrays_by_name.get("fuzz1006").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1639,8 +1297,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2007 = { - let array = arrays_by_name.get("fuzz2007").ok_or_else(|| { + let fuzz1007 = { + let array = arrays_by_name.get("fuzz1007").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1653,8 +1311,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2008 = { - let array = arrays_by_name.get("fuzz2008").ok_or_else(|| { + let fuzz1008 = { + let array = arrays_by_name.get("fuzz1008").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1667,8 +1325,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2009 = { - let array = arrays_by_name.get("fuzz2009").ok_or_else(|| { + let fuzz1009 = { + let array = arrays_by_name.get("fuzz1009").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1681,8 +1339,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2010 = { - let array = arrays_by_name.get("fuzz2010").ok_or_else(|| { + let fuzz1010 = { + let array = arrays_by_name.get("fuzz1010").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1695,8 +1353,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2011 = { - let array = arrays_by_name.get("fuzz2011").ok_or_else(|| { + let fuzz1011 = { + let array = arrays_by_name.get("fuzz1011").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1709,8 +1367,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2012 = { - let array = arrays_by_name.get("fuzz2012").ok_or_else(|| { + let fuzz1012 = { + let array = arrays_by_name.get("fuzz1012").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1723,8 +1381,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2013 = { - let array = arrays_by_name.get("fuzz2013").ok_or_else(|| { + let fuzz1013 = { + let array = arrays_by_name.get("fuzz1013").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1737,8 +1395,8 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; - let fuzz2101 = { - let array = arrays_by_name.get("fuzz2101").ok_or_else(|| { + let fuzz1101 = { + let array = arrays_by_name.get("fuzz1101").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1752,8 +1410,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2102 = { - let array = arrays_by_name.get("fuzz2102").ok_or_else(|| { + let fuzz1102 = { + let array = arrays_by_name.get("fuzz1102").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1767,8 +1425,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2103 = { - let array = arrays_by_name.get("fuzz2103").ok_or_else(|| { + let fuzz1103 = { + let array = arrays_by_name.get("fuzz1103").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1782,8 +1440,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2104 = { - let array = arrays_by_name.get("fuzz2104").ok_or_else(|| { + let fuzz1104 = { + let array = arrays_by_name.get("fuzz1104").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1797,8 +1455,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2105 = { - let array = arrays_by_name.get("fuzz2105").ok_or_else(|| { + let fuzz1105 = { + let array = arrays_by_name.get("fuzz1105").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1812,8 +1470,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2106 = { - let array = arrays_by_name.get("fuzz2106").ok_or_else(|| { + let fuzz1106 = { + let array = arrays_by_name.get("fuzz1106").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1827,8 +1485,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2107 = { - let array = arrays_by_name.get("fuzz2107").ok_or_else(|| { + let fuzz1107 = { + let array = arrays_by_name.get("fuzz1107").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1842,8 +1500,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2108 = { - let array = arrays_by_name.get("fuzz2108").ok_or_else(|| { + let fuzz1108 = { + let array = arrays_by_name.get("fuzz1108").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1857,8 +1515,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2109 = { - let array = arrays_by_name.get("fuzz2109").ok_or_else(|| { + let fuzz1109 = { + let array = arrays_by_name.get("fuzz1109").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1872,8 +1530,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2110 = { - let array = arrays_by_name.get("fuzz2110").ok_or_else(|| { + let fuzz1110 = { + let array = arrays_by_name.get("fuzz1110").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1887,8 +1545,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2111 = { - let array = arrays_by_name.get("fuzz2111").ok_or_else(|| { + let fuzz1111 = { + let array = arrays_by_name.get("fuzz1111").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1902,8 +1560,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2112 = { - let array = arrays_by_name.get("fuzz2112").ok_or_else(|| { + let fuzz1112 = { + let array = arrays_by_name.get("fuzz1112").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1917,8 +1575,8 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; - let fuzz2113 = { - let array = arrays_by_name.get("fuzz2113").ok_or_else(|| { + let fuzz1113 = { + let array = arrays_by_name.get("fuzz1113").ok_or_else(|| { crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, } @@ -1932,6 +1590,357 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; + let fuzz2001 = if let Some(array) = arrays_by_name.get("fuzz2001") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2002 = if let Some(array) = arrays_by_name.get("fuzz2002") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2003 = if let Some(array) = arrays_by_name.get("fuzz2003") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2004 = if let Some(array) = arrays_by_name.get("fuzz2004") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2005 = if let Some(array) = arrays_by_name.get("fuzz2005") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2006 = if let Some(array) = arrays_by_name.get("fuzz2006") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2007 = if let Some(array) = arrays_by_name.get("fuzz2007") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2008 = if let Some(array) = arrays_by_name.get("fuzz2008") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2009 = if let Some(array) = arrays_by_name.get("fuzz2009") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2010 = if let Some(array) = arrays_by_name.get("fuzz2010") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2011 = if let Some(array) = arrays_by_name.get("fuzz2011") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2012 = if let Some(array) = arrays_by_name.get("fuzz2012") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2013 = if let Some(array) = arrays_by_name.get("fuzz2013") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2101 = if let Some(array) = arrays_by_name.get("fuzz2101") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2102 = if let Some(array) = arrays_by_name.get("fuzz2102") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2103 = if let Some(array) = arrays_by_name.get("fuzz2103") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2104 = if let Some(array) = arrays_by_name.get("fuzz2104") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2105 = if let Some(array) = arrays_by_name.get("fuzz2105") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2106 = if let Some(array) = arrays_by_name.get("fuzz2106") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2107 = if let Some(array) = arrays_by_name.get("fuzz2107") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2108 = if let Some(array) = arrays_by_name.get("fuzz2108") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2109 = if let Some(array) = arrays_by_name.get("fuzz2109") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2110 = if let Some(array) = arrays_by_name.get("fuzz2110") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2111 = if let Some(array) = arrays_by_name.get("fuzz2111") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2112 = if let Some(array) = arrays_by_name.get("fuzz2112") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; + let fuzz2113 = if let Some(array) = arrays_by_name.get("fuzz2113") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) + }) + .collect::>>()?, + ) + } else { + None + }; Ok(Self { fuzz1001, fuzz1002, @@ -2017,32 +2026,6 @@ impl AffixFuzzer1 { fuzz1111: impl IntoIterator>, fuzz1112: impl IntoIterator>, fuzz1113: impl IntoIterator>, - fuzz2001: impl Into, - fuzz2002: impl Into, - fuzz2003: impl Into, - fuzz2004: impl Into, - fuzz2005: impl Into, - fuzz2006: impl Into, - fuzz2007: impl Into, - fuzz2008: impl Into, - fuzz2009: impl Into, - fuzz2010: impl Into, - fuzz2011: impl Into, - fuzz2012: impl Into, - fuzz2013: impl Into, - fuzz2101: impl IntoIterator>, - fuzz2102: impl IntoIterator>, - fuzz2103: impl IntoIterator>, - fuzz2104: impl IntoIterator>, - fuzz2105: impl IntoIterator>, - fuzz2106: impl IntoIterator>, - fuzz2107: impl IntoIterator>, - fuzz2108: impl IntoIterator>, - fuzz2109: impl IntoIterator>, - fuzz2110: impl IntoIterator>, - fuzz2111: impl IntoIterator>, - fuzz2112: impl IntoIterator>, - fuzz2113: impl IntoIterator>, ) -> Self { Self { fuzz1001: fuzz1001.into(), @@ -2071,32 +2054,201 @@ impl AffixFuzzer1 { fuzz1111: fuzz1111.into_iter().map(Into::into).collect(), fuzz1112: fuzz1112.into_iter().map(Into::into).collect(), fuzz1113: fuzz1113.into_iter().map(Into::into).collect(), - fuzz2001: fuzz2001.into(), - fuzz2002: fuzz2002.into(), - fuzz2003: fuzz2003.into(), - fuzz2004: fuzz2004.into(), - fuzz2005: fuzz2005.into(), - fuzz2006: fuzz2006.into(), - fuzz2007: fuzz2007.into(), - fuzz2008: fuzz2008.into(), - fuzz2009: fuzz2009.into(), - fuzz2010: fuzz2010.into(), - fuzz2011: fuzz2011.into(), - fuzz2012: fuzz2012.into(), - fuzz2013: fuzz2013.into(), - fuzz2101: fuzz2101.into_iter().map(Into::into).collect(), - fuzz2102: fuzz2102.into_iter().map(Into::into).collect(), - fuzz2103: fuzz2103.into_iter().map(Into::into).collect(), - fuzz2104: fuzz2104.into_iter().map(Into::into).collect(), - fuzz2105: fuzz2105.into_iter().map(Into::into).collect(), - fuzz2106: fuzz2106.into_iter().map(Into::into).collect(), - fuzz2107: fuzz2107.into_iter().map(Into::into).collect(), - fuzz2108: fuzz2108.into_iter().map(Into::into).collect(), - fuzz2109: fuzz2109.into_iter().map(Into::into).collect(), - fuzz2110: fuzz2110.into_iter().map(Into::into).collect(), - fuzz2111: fuzz2111.into_iter().map(Into::into).collect(), - fuzz2112: fuzz2112.into_iter().map(Into::into).collect(), - fuzz2113: fuzz2113.into_iter().map(Into::into).collect(), + fuzz2001: None, + fuzz2002: None, + fuzz2003: None, + fuzz2004: None, + fuzz2005: None, + fuzz2006: None, + fuzz2007: None, + fuzz2008: None, + fuzz2009: None, + fuzz2010: None, + fuzz2011: None, + fuzz2012: None, + fuzz2013: None, + fuzz2101: None, + fuzz2102: None, + fuzz2103: None, + fuzz2104: None, + fuzz2105: None, + fuzz2106: None, + fuzz2107: None, + fuzz2108: None, + fuzz2109: None, + fuzz2110: None, + fuzz2111: None, + fuzz2112: None, + fuzz2113: None, } } + + pub fn with_fuzz2001(mut self, fuzz2001: impl Into) -> Self { + self.fuzz2001 = Some(fuzz2001.into()); + self + } + + pub fn with_fuzz2002(mut self, fuzz2002: impl Into) -> Self { + self.fuzz2002 = Some(fuzz2002.into()); + self + } + + pub fn with_fuzz2003(mut self, fuzz2003: impl Into) -> Self { + self.fuzz2003 = Some(fuzz2003.into()); + self + } + + pub fn with_fuzz2004(mut self, fuzz2004: impl Into) -> Self { + self.fuzz2004 = Some(fuzz2004.into()); + self + } + + pub fn with_fuzz2005(mut self, fuzz2005: impl Into) -> Self { + self.fuzz2005 = Some(fuzz2005.into()); + self + } + + pub fn with_fuzz2006(mut self, fuzz2006: impl Into) -> Self { + self.fuzz2006 = Some(fuzz2006.into()); + self + } + + pub fn with_fuzz2007(mut self, fuzz2007: impl Into) -> Self { + self.fuzz2007 = Some(fuzz2007.into()); + self + } + + pub fn with_fuzz2008(mut self, fuzz2008: impl Into) -> Self { + self.fuzz2008 = Some(fuzz2008.into()); + self + } + + pub fn with_fuzz2009(mut self, fuzz2009: impl Into) -> Self { + self.fuzz2009 = Some(fuzz2009.into()); + self + } + + pub fn with_fuzz2010(mut self, fuzz2010: impl Into) -> Self { + self.fuzz2010 = Some(fuzz2010.into()); + self + } + + pub fn with_fuzz2011(mut self, fuzz2011: impl Into) -> Self { + self.fuzz2011 = Some(fuzz2011.into()); + self + } + + pub fn with_fuzz2012(mut self, fuzz2012: impl Into) -> Self { + self.fuzz2012 = Some(fuzz2012.into()); + self + } + + pub fn with_fuzz2013(mut self, fuzz2013: impl Into) -> Self { + self.fuzz2013 = Some(fuzz2013.into()); + self + } + + pub fn with_fuzz2101( + mut self, + fuzz2101: impl IntoIterator>, + ) -> Self { + self.fuzz2101 = Some(fuzz2101.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2102( + mut self, + fuzz2102: impl IntoIterator>, + ) -> Self { + self.fuzz2102 = Some(fuzz2102.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2103( + mut self, + fuzz2103: impl IntoIterator>, + ) -> Self { + self.fuzz2103 = Some(fuzz2103.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2104( + mut self, + fuzz2104: impl IntoIterator>, + ) -> Self { + self.fuzz2104 = Some(fuzz2104.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2105( + mut self, + fuzz2105: impl IntoIterator>, + ) -> Self { + self.fuzz2105 = Some(fuzz2105.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2106( + mut self, + fuzz2106: impl IntoIterator>, + ) -> Self { + self.fuzz2106 = Some(fuzz2106.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2107( + mut self, + fuzz2107: impl IntoIterator>, + ) -> Self { + self.fuzz2107 = Some(fuzz2107.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2108( + mut self, + fuzz2108: impl IntoIterator>, + ) -> Self { + self.fuzz2108 = Some(fuzz2108.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2109( + mut self, + fuzz2109: impl IntoIterator>, + ) -> Self { + self.fuzz2109 = Some(fuzz2109.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2110( + mut self, + fuzz2110: impl IntoIterator>, + ) -> Self { + self.fuzz2110 = Some(fuzz2110.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2111( + mut self, + fuzz2111: impl IntoIterator>, + ) -> Self { + self.fuzz2111 = Some(fuzz2111.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2112( + mut self, + fuzz2112: impl IntoIterator>, + ) -> Self { + self.fuzz2112 = Some(fuzz2112.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2113( + mut self, + fuzz2113: impl IntoIterator>, + ) -> Self { + self.fuzz2113 = Some(fuzz2113.into_iter().map(Into::into).collect()); + self + } } diff --git a/crates/re_types/src/archetypes/points2d.rs b/crates/re_types/src/archetypes/points2d.rs index 33041a32497d..57db44037fdb 100644 --- a/crates/re_types/src/archetypes/points2d.rs +++ b/crates/re_types/src/archetypes/points2d.rs @@ -46,24 +46,24 @@ pub struct Points2D { pub points: Vec, #[doc = "Optional radii for the points, effectively turning them into circles."] - pub radii: Vec, + pub radii: Option>, #[doc = "Optional colors for the points."] - pub colors: Vec, + pub colors: Option>, #[doc = "Optional text labels for the points."] - pub labels: Vec, + pub labels: Option>, #[doc = "An optional floating point value that specifies the 2D drawing order."] #[doc = "Objects with higher values are drawn on top of those with lower values."] #[doc = ""] #[doc = "The default for 2D points is 30.0."] - pub draw_order: crate::components::DrawOrder, + pub draw_order: Option, #[doc = "Optional class Ids for the points."] #[doc = ""] #[doc = "The class ID provides colors and labels if not specified explicitly."] - pub class_ids: Vec, + pub class_ids: Option>, #[doc = "Optional keypoint IDs for the points, identifying them within a class."] #[doc = ""] @@ -73,10 +73,10 @@ pub struct Points2D { #[doc = "with `class_id`)."] #[doc = "E.g. the classification might be 'Person' and the keypoints refer to joints on a"] #[doc = "detected skeleton."] - pub keypoint_ids: Vec, + pub keypoint_ids: Option>, #[doc = "Unique identifiers for each individual point in the batch."] - pub instance_keys: Vec, + pub instance_keys: Option>, } impl Points2D { @@ -156,131 +156,139 @@ impl crate::Archetype for Points2D { .transpose()? }, { - Some({ - let array = ::try_to_arrow(self.radii.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Radius".into(), - Box::new(array.data_type().clone()), - Some("rerun.radius".into()), - ); - ( - ::arrow2::datatypes::Field::new("radii", datatype, false), - array, - ) + self.radii + .as_ref() + .map(|many| { + let array = ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Radius".into(), + Box::new(array.data_type().clone()), + Some("rerun.radius".into()), + ); + ( + ::arrow2::datatypes::Field::new("radii", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = ::try_to_arrow(self.colors.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Color".into(), - Box::new(array.data_type().clone()), - Some("rerun.colorrgba".into()), - ); - ( - ::arrow2::datatypes::Field::new("colors", datatype, false), - array, - ) + self.colors + .as_ref() + .map(|many| { + let array = ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Color".into(), + Box::new(array.data_type().clone()), + Some("rerun.colorrgba".into()), + ); + ( + ::arrow2::datatypes::Field::new("colors", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = ::try_to_arrow(self.labels.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.Label".into(), - Box::new(array.data_type().clone()), - Some("rerun.label".into()), - ); - ( - ::arrow2::datatypes::Field::new("labels", datatype, false), - array, - ) + self.labels + .as_ref() + .map(|many| { + let array = ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.Label".into(), + Box::new(array.data_type().clone()), + Some("rerun.label".into()), + ); + ( + ::arrow2::datatypes::Field::new("labels", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = - ::try_to_arrow([&self.draw_order], None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.DrawOrder".into(), - Box::new(array.data_type().clone()), - Some("rerun.draw_order".into()), - ); - ( - ::arrow2::datatypes::Field::new("draw_order", datatype, false), - array, - ) + self.draw_order + .as_ref() + .map(|single| { + let array = ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.DrawOrder".into(), + Box::new(array.data_type().clone()), + Some("rerun.draw_order".into()), + ); + ( + ::arrow2::datatypes::Field::new("draw_order", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = - ::try_to_arrow(self.class_ids.iter(), None); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.ClassId".into(), - Box::new(array.data_type().clone()), - Some("rerun.class_id".into()), - ); - ( - ::arrow2::datatypes::Field::new("class_ids", datatype, false), - array, - ) + self.class_ids + .as_ref() + .map(|many| { + let array = ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.ClassId".into(), + Box::new(array.data_type().clone()), + Some("rerun.class_id".into()), + ); + ( + ::arrow2::datatypes::Field::new("class_ids", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = ::try_to_arrow( - self.keypoint_ids.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.KeypointId".into(), - Box::new(array.data_type().clone()), - Some("rerun.keypoint_id".into()), - ); - ( - ::arrow2::datatypes::Field::new("keypoint_ids", datatype, false), - array, - ) + self.keypoint_ids + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.KeypointId".into(), + Box::new(array.data_type().clone()), + Some("rerun.keypoint_id".into()), + ); + ( + ::arrow2::datatypes::Field::new("keypoint_ids", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, { - Some({ - let array = ::try_to_arrow( - self.instance_keys.iter(), - None, - ); - array.map(|array| { - let datatype = ::arrow2::datatypes::DataType::Extension( - "rerun.components.InstanceKey".into(), - Box::new(array.data_type().clone()), - Some("rerun.instance_key".into()), - ); - ( - ::arrow2::datatypes::Field::new("instance_keys", datatype, false), - array, - ) + self.instance_keys + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.components.InstanceKey".into(), + Box::new(array.data_type().clone()), + Some("rerun.instance_key".into()), + ); + ( + ::arrow2::datatypes::Field::new("instance_keys", datatype, false), + array, + ) + }) }) - }) - .transpose()? + .transpose()? }, ] .into_iter() @@ -312,109 +320,102 @@ impl crate::Archetype for Points2D { }) .collect::>>()? }; - let radii = { - let array = arrays_by_name.get("radii").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let radii = if let Some(array) = arrays_by_name.get("radii") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let colors = { - let array = arrays_by_name.get("colors").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let colors = if let Some(array) = arrays_by_name.get("colors") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let labels = { - let array = arrays_by_name.get("labels").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let labels = if let Some(array) = arrays_by_name.get("labels") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let draw_order = { - let array = arrays_by_name.get("draw_order").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .next() - .flatten() - .ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - })? - }; - let class_ids = { - let array = arrays_by_name.get("class_ids").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { + let draw_order = if let Some(array) = arrays_by_name.get("draw_order") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let class_ids = if let Some(array) = arrays_by_name.get("class_ids") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let keypoint_ids = { - let array = arrays_by_name.get("keypoint_ids").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let keypoint_ids = if let Some(array) = arrays_by_name.get("keypoint_ids") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; - let instance_keys = { - let array = arrays_by_name.get("instance_keys").ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, - } - })?; - ::try_from_arrow_opt(&**array)? - .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: ::arrow2::datatypes::DataType::Null, + let instance_keys = if let Some(array) = arrays_by_name.get("instance_keys") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + }) }) - }) - .collect::>>()? + .collect::>>()?, + ) + } else { + None }; Ok(Self { points, @@ -430,25 +431,69 @@ impl crate::Archetype for Points2D { } impl Points2D { - pub fn new( - points: impl IntoIterator>, + pub fn new(points: impl IntoIterator>) -> Self { + Self { + points: points.into_iter().map(Into::into).collect(), + radii: None, + colors: None, + labels: None, + draw_order: None, + class_ids: None, + keypoint_ids: None, + instance_keys: None, + } + } + + pub fn with_radii( + mut self, radii: impl IntoIterator>, + ) -> Self { + self.radii = Some(radii.into_iter().map(Into::into).collect()); + self + } + + pub fn with_colors( + mut self, colors: impl IntoIterator>, + ) -> Self { + self.colors = Some(colors.into_iter().map(Into::into).collect()); + self + } + + pub fn with_labels( + mut self, labels: impl IntoIterator>, - draw_order: impl Into, + ) -> Self { + self.labels = Some(labels.into_iter().map(Into::into).collect()); + self + } + + pub fn with_draw_order(mut self, draw_order: impl Into) -> Self { + self.draw_order = Some(draw_order.into()); + self + } + + pub fn with_class_ids( + mut self, class_ids: impl IntoIterator>, + ) -> Self { + self.class_ids = Some(class_ids.into_iter().map(Into::into).collect()); + self + } + + pub fn with_keypoint_ids( + mut self, keypoint_ids: impl IntoIterator>, + ) -> Self { + self.keypoint_ids = Some(keypoint_ids.into_iter().map(Into::into).collect()); + self + } + + pub fn with_instance_keys( + mut self, instance_keys: impl IntoIterator>, ) -> Self { - Self { - points: points.into_iter().map(Into::into).collect(), - radii: radii.into_iter().map(Into::into).collect(), - colors: colors.into_iter().map(Into::into).collect(), - labels: labels.into_iter().map(Into::into).collect(), - draw_order: draw_order.into(), - class_ids: class_ids.into_iter().map(Into::into).collect(), - keypoint_ids: keypoint_ids.into_iter().map(Into::into).collect(), - instance_keys: instance_keys.into_iter().map(Into::into).collect(), - } + self.instance_keys = Some(instance_keys.into_iter().map(Into::into).collect()); + self } } diff --git a/crates/re_types/src/components/fuzzy.rs b/crates/re_types/src/components/fuzzy.rs index ec772023718b..92d070bd0bd5 100644 --- a/crates/re_types/src/components/fuzzy.rs +++ b/crates/re_types/src/components/fuzzy.rs @@ -42,7 +42,7 @@ impl crate::Component for AffixFuzzer1 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -54,7 +54,7 @@ impl crate::Component for AffixFuzzer1 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -62,10 +62,10 @@ impl crate::Component for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -84,10 +84,10 @@ impl crate::Component for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -199,7 +199,7 @@ impl crate::Component for AffixFuzzer2 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -211,7 +211,7 @@ impl crate::Component for AffixFuzzer2 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -219,10 +219,10 @@ impl crate::Component for AffixFuzzer2 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -241,10 +241,10 @@ impl crate::Component for AffixFuzzer2 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -358,7 +358,7 @@ impl crate::Component for AffixFuzzer3 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -370,7 +370,7 @@ impl crate::Component for AffixFuzzer3 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -378,10 +378,10 @@ impl crate::Component for AffixFuzzer3 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -400,10 +400,10 @@ impl crate::Component for AffixFuzzer3 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -486,7 +486,7 @@ impl crate::Component for AffixFuzzer3 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer4 { - pub single_optional: crate::datatypes::AffixFuzzer1, + pub single_optional: Option, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer4> { @@ -517,7 +517,7 @@ impl crate::Component for AffixFuzzer4 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -529,7 +529,7 @@ impl crate::Component for AffixFuzzer4 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -537,10 +537,10 @@ impl crate::Component for AffixFuzzer4 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -559,10 +559,10 @@ impl crate::Component for AffixFuzzer4 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -600,10 +600,12 @@ impl crate::Component for AffixFuzzer4 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { single_optional } = datum.into_owned(); - single_optional - }); + let datum = datum + .map(|datum| { + let Self { single_optional } = datum.into_owned(); + single_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -633,18 +635,14 @@ impl crate::Component for AffixFuzzer4 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|single_optional| Some(Self { single_optional }))) .collect::>>>()?) } } #[derive(Debug, Clone, PartialEq)] -pub struct AffixFuzzer5(pub crate::datatypes::AffixFuzzer1); +pub struct AffixFuzzer5(pub Option); impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer5> { #[inline] @@ -674,7 +672,7 @@ impl crate::Component for AffixFuzzer5 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -686,7 +684,7 @@ impl crate::Component for AffixFuzzer5 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -694,10 +692,10 @@ impl crate::Component for AffixFuzzer5 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -716,10 +714,10 @@ impl crate::Component for AffixFuzzer5 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -757,10 +755,12 @@ impl crate::Component for AffixFuzzer5 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self(data0) = datum.into_owned(); - data0 - }); + let datum = datum + .map(|datum| { + let Self(data0) = datum.into_owned(); + data0 + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -790,11 +790,7 @@ impl crate::Component for AffixFuzzer5 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>()?) } @@ -802,7 +798,7 @@ impl crate::Component for AffixFuzzer5 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer6 { - pub single_optional: crate::datatypes::AffixFuzzer1, + pub single_optional: Option, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer6> { @@ -833,7 +829,7 @@ impl crate::Component for AffixFuzzer6 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -845,7 +841,7 @@ impl crate::Component for AffixFuzzer6 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -853,10 +849,10 @@ impl crate::Component for AffixFuzzer6 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -875,10 +871,10 @@ impl crate::Component for AffixFuzzer6 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -916,10 +912,12 @@ impl crate::Component for AffixFuzzer6 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { single_optional } = datum.into_owned(); - single_optional - }); + let datum = datum + .map(|datum| { + let Self { single_optional } = datum.into_owned(); + single_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -949,11 +947,7 @@ impl crate::Component for AffixFuzzer6 { use ::arrow2::{array::*, datatypes::*}; Ok(crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? .into_iter() - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|single_optional| Some(Self { single_optional }))) .collect::>>>()?) } @@ -961,7 +955,7 @@ impl crate::Component for AffixFuzzer6 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer7 { - pub many_optional: Vec, + pub many_optional: Option>, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer7> { @@ -994,7 +988,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1006,7 +1000,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1014,10 +1008,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1036,10 +1030,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1060,7 +1054,7 @@ impl crate::Component for AffixFuzzer7 { metadata: [].into(), }, ]), - is_nullable: false, + is_nullable: true, metadata: [].into(), })) } @@ -1080,10 +1074,12 @@ impl crate::Component for AffixFuzzer7 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { many_optional } = datum.into_owned(); - many_optional - }); + let datum = datum + .map(|datum| { + let Self { many_optional } = datum.into_owned(); + many_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1127,7 +1123,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1139,7 +1135,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1147,10 +1143,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1169,10 +1165,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1193,7 +1189,7 @@ impl crate::Component for AffixFuzzer7 { metadata: [].into(), }, ]), - is_nullable: false, + is_nullable: true, metadata: [].into(), }))), None, @@ -1246,7 +1242,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1258,7 +1254,7 @@ impl crate::Component for AffixFuzzer7 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1266,10 +1262,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1288,10 +1284,10 @@ impl crate::Component for AffixFuzzer7 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -1336,11 +1332,7 @@ impl crate::Component for AffixFuzzer7 { .collect::>>>()? .into_iter() } - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|many_optional| Some(Self { many_optional }))) .collect::>>>()?) } @@ -1348,7 +1340,7 @@ impl crate::Component for AffixFuzzer7 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer8 { - pub single_float_optional: f32, + pub single_float_optional: Option, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer8> { @@ -1393,12 +1385,14 @@ impl crate::Component for AffixFuzzer8 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { - single_float_optional, - } = datum.into_owned(); - single_float_optional - }); + let datum = datum + .map(|datum| { + let Self { + single_float_optional, + } = datum.into_owned(); + single_float_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1442,11 +1436,7 @@ impl crate::Component for AffixFuzzer8 { .unwrap() .into_iter() .map(|v| v.copied()) - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| { res.map(|single_float_optional| { Some(Self { @@ -1587,7 +1577,7 @@ impl crate::Component for AffixFuzzer9 { #[derive(Debug, Clone, PartialEq, Eq)] pub struct AffixFuzzer10 { - pub single_string_optional: String, + pub single_string_optional: Option, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer10> { @@ -1632,12 +1622,14 @@ impl crate::Component for AffixFuzzer10 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { - single_string_optional, - } = datum.into_owned(); - single_string_optional - }); + let datum = datum + .map(|datum| { + let Self { + single_string_optional, + } = datum.into_owned(); + single_string_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1696,11 +1688,7 @@ impl crate::Component for AffixFuzzer10 { .unwrap() .into_iter() .map(|v| v.map(ToOwned::to_owned)) - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| { res.map(|single_string_optional| { Some(Self { @@ -1714,7 +1702,7 @@ impl crate::Component for AffixFuzzer10 { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer11 { - pub many_floats_optional: Vec, + pub many_floats_optional: Option>, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer11> { @@ -1744,7 +1732,7 @@ impl crate::Component for AffixFuzzer11 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })) } @@ -1764,12 +1752,14 @@ impl crate::Component for AffixFuzzer11 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { - many_floats_optional, - } = datum.into_owned(); - many_floats_optional - }); + let datum = datum + .map(|datum| { + let Self { + many_floats_optional, + } = datum.into_owned(); + many_floats_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1810,7 +1800,7 @@ impl crate::Component for AffixFuzzer11 { Box::new(DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }))), None, @@ -1898,11 +1888,7 @@ impl crate::Component for AffixFuzzer11 { .collect::>>>()? .into_iter() } - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| { res.map(|many_floats_optional| { Some(Self { @@ -2134,7 +2120,7 @@ impl crate::Component for AffixFuzzer12 { #[derive(Debug, Clone, PartialEq, Eq)] pub struct AffixFuzzer13 { - pub many_strings_optional: Vec, + pub many_strings_optional: Option>, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer13> { @@ -2164,7 +2150,7 @@ impl crate::Component for AffixFuzzer13 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })) } @@ -2184,12 +2170,14 @@ impl crate::Component for AffixFuzzer13 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self { - many_strings_optional, - } = datum.into_owned(); - many_strings_optional - }); + let datum = datum + .map(|datum| { + let Self { + many_strings_optional, + } = datum.into_owned(); + many_strings_optional + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -2230,7 +2218,7 @@ impl crate::Component for AffixFuzzer13 { Box::new(DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }))), None, @@ -2334,11 +2322,7 @@ impl crate::Component for AffixFuzzer13 { .collect::>>>()? .into_iter() } - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| { res.map(|many_strings_optional| { Some(Self { diff --git a/crates/re_types/src/datatypes/fuzzy.rs b/crates/re_types/src/datatypes/fuzzy.rs index c73fbbeb3f7b..8498243f1c7d 100644 --- a/crates/re_types/src/datatypes/fuzzy.rs +++ b/crates/re_types/src/datatypes/fuzzy.rs @@ -167,12 +167,12 @@ impl crate::Datatype for FlattenedScalar { #[derive(Debug, Clone, PartialEq)] pub struct AffixFuzzer1 { - pub single_float_optional: f32, + pub single_float_optional: Option, pub single_string_required: String, - pub single_string_optional: String, - pub many_floats_optional: Vec, + pub single_string_optional: Option, + pub many_floats_optional: Option>, pub many_strings_required: Vec, - pub many_strings_optional: Vec, + pub many_strings_optional: Option>, pub flattened_scalar: f32, pub almost_flattened_scalar: crate::datatypes::FlattenedScalar, } @@ -205,7 +205,7 @@ impl crate::Datatype for AffixFuzzer1 { Field { name: "single_float_optional".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -217,7 +217,7 @@ impl crate::Datatype for AffixFuzzer1 { Field { name: "single_string_optional".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -225,10 +225,10 @@ impl crate::Datatype for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -247,10 +247,10 @@ impl crate::Datatype for AffixFuzzer1 { data_type: DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })), - is_nullable: false, + is_nullable: true, metadata: [].into(), }, Field { @@ -312,13 +312,16 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, single_float_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum.as_ref().map(|datum| { - let Self { - single_float_optional, - .. - } = &**datum; - single_float_optional.clone() - }); + let datum = datum + .as_ref() + .map(|datum| { + let Self { + single_float_optional, + .. + } = &**datum; + single_float_optional.clone() + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -389,13 +392,16 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, single_string_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum.as_ref().map(|datum| { - let Self { - single_string_optional, - .. - } = &**datum; - single_string_optional.clone() - }); + let datum = datum + .as_ref() + .map(|datum| { + let Self { + single_string_optional, + .. + } = &**datum; + single_string_optional.clone() + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -435,13 +441,16 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, many_floats_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum.as_ref().map(|datum| { - let Self { - many_floats_optional, - .. - } = &**datum; - many_floats_optional.clone() - }); + let datum = datum + .as_ref() + .map(|datum| { + let Self { + many_floats_optional, + .. + } = &**datum; + many_floats_optional.clone() + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -483,7 +492,7 @@ impl crate::Datatype for AffixFuzzer1 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, - is_nullable: false, + is_nullable: true, metadata: [].into(), })) .to_logical_type() @@ -606,13 +615,16 @@ impl crate::Datatype for AffixFuzzer1 { let (somes, many_strings_optional): (Vec<_>, Vec<_>) = data .iter() .map(|datum| { - let datum = datum.as_ref().map(|datum| { - let Self { - many_strings_optional, - .. - } = &**datum; - many_strings_optional.clone() - }); + let datum = datum + .as_ref() + .map(|datum| { + let Self { + many_strings_optional, + .. + } = &**datum; + many_strings_optional.clone() + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -654,7 +666,7 @@ impl crate::Datatype for AffixFuzzer1 { DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, - is_nullable: false, + is_nullable: true, metadata: [].into(), })) .to_logical_type() @@ -1008,36 +1020,20 @@ impl crate::Datatype for AffixFuzzer1 { is_valid(i) .then(|| { Ok(Self { - single_float_optional: single_float_optional.ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - } - })?, + single_float_optional, single_string_required: single_string_required.ok_or_else( || crate::DeserializationError::MissingData { datatype: data.data_type().clone(), }, )?, - single_string_optional: single_string_optional.ok_or_else( - || crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }, - )?, - many_floats_optional: many_floats_optional.ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - } - })?, + single_string_optional, + many_floats_optional, many_strings_required: many_strings_required.ok_or_else(|| { crate::DeserializationError::MissingData { datatype: data.data_type().clone(), } })?, - many_strings_optional: many_strings_optional.ok_or_else(|| { - crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - } - })?, + many_strings_optional, flattened_scalar: flattened_scalar.ok_or_else(|| { crate::DeserializationError::MissingData { datatype: data.data_type().clone(), @@ -1059,7 +1055,7 @@ impl crate::Datatype for AffixFuzzer1 { } #[derive(Debug, Clone, PartialEq)] -pub struct AffixFuzzer2(pub f32); +pub struct AffixFuzzer2(pub Option); impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer2> { #[inline] @@ -1103,10 +1099,12 @@ impl crate::Datatype for AffixFuzzer2 { .into_iter() .map(|datum| { let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); - let datum = datum.map(|datum| { - let Self(data0) = datum.into_owned(); - data0 - }); + let datum = datum + .map(|datum| { + let Self(data0) = datum.into_owned(); + data0 + }) + .flatten(); (datum.is_some(), datum) }) .unzip(); @@ -1147,11 +1145,7 @@ impl crate::Datatype for AffixFuzzer2 { .unwrap() .into_iter() .map(|v| v.copied()) - .map(|v| { - v.ok_or_else(|| crate::DeserializationError::MissingData { - datatype: data.data_type().clone(), - }) - }) + .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>()?) } diff --git a/crates/re_types/tests/fuzzy.rs b/crates/re_types/tests/fuzzy.rs index 37d78baf8950..3e471b2dbd7c 100644 --- a/crates/re_types/tests/fuzzy.rs +++ b/crates/re_types/tests/fuzzy.rs @@ -15,7 +15,7 @@ fn roundtrip() { many_strings_required: vec!["1".into(), "2".into()], many_strings_optional: Some(vec!["10".into(), "20".into()]), flattened_scalar: 42.0, - almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: Some(42.0) }, + almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: 42.0 }, }, }; @@ -27,7 +27,7 @@ fn roundtrip() { many_strings_required: vec!["3".into(), "4".into()], many_strings_optional: None, flattened_scalar: 43.0, - almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: Some(43.0) }, + almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: 43.0 }, }); let fuzzy3 = re_types::components::AffixFuzzer3 { @@ -39,7 +39,7 @@ fn roundtrip() { many_strings_required: vec!["5".into(), "6".into()], many_strings_optional: Some(vec!["50".into(), "60".into()]), flattened_scalar: 44.0, - almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: Some(44.0) }, + almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: 44.0 }, }, }; @@ -52,7 +52,7 @@ fn roundtrip() { many_strings_required: vec!["7".into(), "8".into()], many_strings_optional: None, flattened_scalar: 45.0, - almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: Some(45.0) }, + almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: 45.0 }, }), }; @@ -92,7 +92,7 @@ fn roundtrip() { many_strings_required: vec!["7".into(), "8".into()], many_strings_optional: None, flattened_scalar: 46.0, - almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: Some(46.0) }, + almost_flattened_scalar: re_types::datatypes::FlattenedScalar { value: 46.0 }, }]), }; diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py index 36ed3b9895cb..ce6276757eaa 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py @@ -118,108 +118,134 @@ class AffixFuzzer1(Archetype): metadata={"component": "primary"}, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) - fuzz2001: components.AffixFuzzer1Array = field( - metadata={"component": "primary"}, + fuzz2001: components.AffixFuzzer1Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer1Array.from_similar, # type: ignore[misc] ) - fuzz2002: components.AffixFuzzer2Array = field( - metadata={"component": "primary"}, + fuzz2002: components.AffixFuzzer2Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer2Array.from_similar, # type: ignore[misc] ) - fuzz2003: components.AffixFuzzer3Array = field( - metadata={"component": "primary"}, + fuzz2003: components.AffixFuzzer3Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer3Array.from_similar, # type: ignore[misc] ) - fuzz2004: components.AffixFuzzer4Array = field( - metadata={"component": "primary"}, + fuzz2004: components.AffixFuzzer4Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer4Array.from_similar, # type: ignore[misc] ) - fuzz2005: components.AffixFuzzer5Array = field( - metadata={"component": "primary"}, + fuzz2005: components.AffixFuzzer5Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer5Array.from_similar, # type: ignore[misc] ) - fuzz2006: components.AffixFuzzer6Array = field( - metadata={"component": "primary"}, + fuzz2006: components.AffixFuzzer6Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer6Array.from_similar, # type: ignore[misc] ) - fuzz2007: components.AffixFuzzer7Array = field( - metadata={"component": "primary"}, + fuzz2007: components.AffixFuzzer7Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer7Array.from_similar, # type: ignore[misc] ) - fuzz2008: components.AffixFuzzer8Array = field( - metadata={"component": "primary"}, + fuzz2008: components.AffixFuzzer8Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer8Array.from_similar, # type: ignore[misc] ) - fuzz2009: components.AffixFuzzer9Array = field( - metadata={"component": "primary"}, + fuzz2009: components.AffixFuzzer9Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer9Array.from_similar, # type: ignore[misc] ) - fuzz2010: components.AffixFuzzer10Array = field( - metadata={"component": "primary"}, + fuzz2010: components.AffixFuzzer10Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer10Array.from_similar, # type: ignore[misc] ) - fuzz2011: components.AffixFuzzer11Array = field( - metadata={"component": "primary"}, + fuzz2011: components.AffixFuzzer11Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer11Array.from_similar, # type: ignore[misc] ) - fuzz2012: components.AffixFuzzer12Array = field( - metadata={"component": "primary"}, + fuzz2012: components.AffixFuzzer12Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer12Array.from_similar, # type: ignore[misc] ) - fuzz2013: components.AffixFuzzer13Array = field( - metadata={"component": "primary"}, + fuzz2013: components.AffixFuzzer13Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) - fuzz2101: components.AffixFuzzer1Array = field( - metadata={"component": "primary"}, + fuzz2101: components.AffixFuzzer1Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer1Array.from_similar, # type: ignore[misc] ) - fuzz2102: components.AffixFuzzer2Array = field( - metadata={"component": "primary"}, + fuzz2102: components.AffixFuzzer2Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer2Array.from_similar, # type: ignore[misc] ) - fuzz2103: components.AffixFuzzer3Array = field( - metadata={"component": "primary"}, + fuzz2103: components.AffixFuzzer3Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer3Array.from_similar, # type: ignore[misc] ) - fuzz2104: components.AffixFuzzer4Array = field( - metadata={"component": "primary"}, + fuzz2104: components.AffixFuzzer4Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer4Array.from_similar, # type: ignore[misc] ) - fuzz2105: components.AffixFuzzer5Array = field( - metadata={"component": "primary"}, + fuzz2105: components.AffixFuzzer5Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer5Array.from_similar, # type: ignore[misc] ) - fuzz2106: components.AffixFuzzer6Array = field( - metadata={"component": "primary"}, + fuzz2106: components.AffixFuzzer6Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer6Array.from_similar, # type: ignore[misc] ) - fuzz2107: components.AffixFuzzer7Array = field( - metadata={"component": "primary"}, + fuzz2107: components.AffixFuzzer7Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer7Array.from_similar, # type: ignore[misc] ) - fuzz2108: components.AffixFuzzer8Array = field( - metadata={"component": "primary"}, + fuzz2108: components.AffixFuzzer8Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer8Array.from_similar, # type: ignore[misc] ) - fuzz2109: components.AffixFuzzer9Array = field( - metadata={"component": "primary"}, + fuzz2109: components.AffixFuzzer9Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer9Array.from_similar, # type: ignore[misc] ) - fuzz2110: components.AffixFuzzer10Array = field( - metadata={"component": "primary"}, + fuzz2110: components.AffixFuzzer10Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer10Array.from_similar, # type: ignore[misc] ) - fuzz2111: components.AffixFuzzer11Array = field( - metadata={"component": "primary"}, + fuzz2111: components.AffixFuzzer11Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer11Array.from_similar, # type: ignore[misc] ) - fuzz2112: components.AffixFuzzer12Array = field( - metadata={"component": "primary"}, + fuzz2112: components.AffixFuzzer12Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer12Array.from_similar, # type: ignore[misc] ) - fuzz2113: components.AffixFuzzer13Array = field( - metadata={"component": "primary"}, + fuzz2113: components.AffixFuzzer13Array | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) __str__ = Archetype.__str__ diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py index 30a6ba3c8537..958554bfe062 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/points2d.py @@ -39,16 +39,18 @@ class Points2D(Archetype): All the actual 2D points that make up the point cloud. """ - radii: components.RadiusArray = field( - metadata={"component": "primary"}, + radii: components.RadiusArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.RadiusArray.from_similar, # type: ignore[misc] ) """ Optional radii for the points, effectively turning them into circles. """ - colors: components.ColorArray = field( - metadata={"component": "primary"}, + colors: components.ColorArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.ColorArray.from_similar, # type: ignore[misc] ) """ @@ -58,16 +60,18 @@ class Points2D(Archetype): As either 0-1 floats or 0-255 integers, with separate alpha. """ - labels: components.LabelArray = field( - metadata={"component": "primary"}, + labels: components.LabelArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.LabelArray.from_similar, # type: ignore[misc] ) """ Optional text labels for the points. """ - draw_order: components.DrawOrderArray = field( - metadata={"component": "primary"}, + draw_order: components.DrawOrderArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.DrawOrderArray.from_similar, # type: ignore[misc] ) """ @@ -77,8 +81,9 @@ class Points2D(Archetype): The default for 2D points is 30.0. """ - class_ids: components.ClassIdArray = field( - metadata={"component": "primary"}, + class_ids: components.ClassIdArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.ClassIdArray.from_similar, # type: ignore[misc] ) """ @@ -87,8 +92,9 @@ class Points2D(Archetype): The class ID provides colors and labels if not specified explicitly. """ - keypoint_ids: components.KeypointIdArray = field( - metadata={"component": "primary"}, + keypoint_ids: components.KeypointIdArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.KeypointIdArray.from_similar, # type: ignore[misc] ) """ @@ -102,8 +108,9 @@ class Points2D(Archetype): detected skeleton. """ - instance_keys: components.InstanceKeyArray = field( - metadata={"component": "primary"}, + instance_keys: components.InstanceKeyArray | None = field( + metadata={"component": "secondary"}, + default=None, converter=components.InstanceKeyArray.from_similar, # type: ignore[misc] ) """ diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py index eea3d32730bc..734bce377269 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py @@ -175,7 +175,7 @@ class AffixFuzzer6Array(BaseDelegatingExtensionArray[datatypes.AffixFuzzer1Array @define class AffixFuzzer7: - many_optional: list[datatypes.AffixFuzzer1] = field() + many_optional: list[datatypes.AffixFuzzer1] | None = field(default=None) AffixFuzzer7Like = AffixFuzzer7 @@ -197,17 +197,17 @@ def __init__(self) -> None: "item", pa.struct( [ - pa.field("single_float_optional", pa.float32(), False, {}), + pa.field("single_float_optional", pa.float32(), True, {}), pa.field("single_string_required", pa.utf8(), False, {}), - pa.field("single_string_optional", pa.utf8(), False, {}), + pa.field("single_string_optional", pa.utf8(), True, {}), pa.field( - "many_floats_optional", pa.list_(pa.field("item", pa.float32(), False, {})), False, {} + "many_floats_optional", pa.list_(pa.field("item", pa.float32(), True, {})), True, {} ), pa.field( "many_strings_required", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {} ), pa.field( - "many_strings_optional", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {} + "many_strings_optional", pa.list_(pa.field("item", pa.utf8(), True, {})), True, {} ), pa.field("flattened_scalar", pa.float32(), False, {}), pa.field( @@ -218,7 +218,7 @@ def __init__(self) -> None: ), ] ), - False, + True, {}, ) ), @@ -243,14 +243,11 @@ def _native_to_pa_array(data: AffixFuzzer7ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer8: - single_float_optional: float = field() + single_float_optional: float | None = field(default=None) def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.single_float_optional, dtype=dtype) - def __float__(self) -> float: - return float(self.single_float_optional) - AffixFuzzer8Like = AffixFuzzer8 AffixFuzzer8ArrayLike = Union[ @@ -322,10 +319,7 @@ def _native_to_pa_array(data: AffixFuzzer9ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer10: - single_string_optional: str = field() - - def __str__(self) -> str: - return str(self.single_string_optional) + single_string_optional: str | None = field(default=None) AffixFuzzer10Like = AffixFuzzer10 @@ -360,7 +354,7 @@ def _native_to_pa_array(data: AffixFuzzer10ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer11: - many_floats_optional: npt.NDArray[np.float32] = field(converter=to_np_float32) + many_floats_optional: npt.NDArray[np.float32] | None = field(default=None, converter=to_np_float32) def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.many_floats_optional, dtype=dtype) @@ -379,7 +373,7 @@ def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: class AffixFuzzer11Type(BaseExtensionType): def __init__(self) -> None: pa.ExtensionType.__init__( - self, pa.list_(pa.field("item", pa.float32(), False, {})), "rerun.testing.components.AffixFuzzer11" + self, pa.list_(pa.field("item", pa.float32(), True, {})), "rerun.testing.components.AffixFuzzer11" ) @@ -437,7 +431,7 @@ def _native_to_pa_array(data: AffixFuzzer12ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer13: - many_strings_optional: list[str] = field() + many_strings_optional: list[str] | None = field(default=None) AffixFuzzer13Like = AffixFuzzer13 @@ -453,7 +447,7 @@ class AffixFuzzer13: class AffixFuzzer13Type(BaseExtensionType): def __init__(self) -> None: pa.ExtensionType.__init__( - self, pa.list_(pa.field("item", pa.utf8(), False, {})), "rerun.testing.components.AffixFuzzer13" + self, pa.list_(pa.field("item", pa.utf8(), True, {})), "rerun.testing.components.AffixFuzzer13" ) diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py index baf211917924..6a69a09ed79a 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py @@ -82,14 +82,14 @@ def _native_to_pa_array(data: FlattenedScalarArrayLike, data_type: pa.DataType) @define class AffixFuzzer1: - single_float_optional: float = field() single_string_required: str = field() - single_string_optional: str = field() - many_floats_optional: npt.NDArray[np.float32] = field(converter=to_np_float32) many_strings_required: list[str] = field() - many_strings_optional: list[str] = field() flattened_scalar: float = field() almost_flattened_scalar: datatypes.FlattenedScalar = field() + single_float_optional: float | None = field(default=None) + single_string_optional: str | None = field(default=None) + many_floats_optional: npt.NDArray[np.float32] | None = field(default=None, converter=to_np_float32) + many_strings_optional: list[str] | None = field(default=None) AffixFuzzer1Like = AffixFuzzer1 @@ -108,12 +108,12 @@ def __init__(self) -> None: self, pa.struct( [ - pa.field("single_float_optional", pa.float32(), False, {}), + pa.field("single_float_optional", pa.float32(), True, {}), pa.field("single_string_required", pa.utf8(), False, {}), - pa.field("single_string_optional", pa.utf8(), False, {}), - pa.field("many_floats_optional", pa.list_(pa.field("item", pa.float32(), False, {})), False, {}), + pa.field("single_string_optional", pa.utf8(), True, {}), + pa.field("many_floats_optional", pa.list_(pa.field("item", pa.float32(), True, {})), True, {}), pa.field("many_strings_required", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {}), - pa.field("many_strings_optional", pa.list_(pa.field("item", pa.utf8(), False, {})), False, {}), + pa.field("many_strings_optional", pa.list_(pa.field("item", pa.utf8(), True, {})), True, {}), pa.field("flattened_scalar", pa.float32(), False, {}), pa.field( "almost_flattened_scalar", pa.struct([pa.field("value", pa.float32(), False, {})]), False, {} @@ -141,14 +141,11 @@ def _native_to_pa_array(data: AffixFuzzer1ArrayLike, data_type: pa.DataType) -> @define class AffixFuzzer2: - single_float_optional: float = field() + single_float_optional: float | None = field(default=None) def __array__(self, dtype: npt.DTypeLike = None) -> npt.ArrayLike: return np.asarray(self.single_float_optional, dtype=dtype) - def __float__(self) -> float: - return float(self.single_float_optional) - AffixFuzzer2Like = AffixFuzzer2 AffixFuzzer2ArrayLike = Union[ From cf7c2a472cdad1eea5f97c4c2c474f0a518a2636 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 16:29:29 +0200 Subject: [PATCH 4/4] is_nullable -> nullable in fbs --- .../re_types/definitions/fbs/attributes.fbs | 2 +- .../definitions/rerun/archetypes/points2d.fbs | 14 ++--- .../rerun/testing/archetypes/fuzzy.fbs | 52 +++++++++---------- .../rerun/testing/components/fuzzy.fbs | 16 +++--- .../rerun/testing/datatypes/fuzzy.fbs | 10 ++-- crates/re_types/source_hash.txt | 2 +- crates/re_types_builder/src/lib.rs | 2 +- crates/re_types_builder/src/objects.rs | 4 +- 8 files changed, 51 insertions(+), 51 deletions(-) diff --git a/crates/re_types/definitions/fbs/attributes.fbs b/crates/re_types/definitions/fbs/attributes.fbs index 97c46946ab9e..48a33ecf7c45 100644 --- a/crates/re_types/definitions/fbs/attributes.fbs +++ b/crates/re_types/definitions/fbs/attributes.fbs @@ -37,4 +37,4 @@ attribute "transparent"; /// NOTE: We do not use flatbuffers' builtin `required` attribute because A) it has many /// limitations that do not make sense for our use case and B) our overall data model is built /// around the idea of nullability, rather than requirements (i.e. the exact opposite). -attribute "is_nullable"; +attribute "nullable"; diff --git a/crates/re_types/definitions/rerun/archetypes/points2d.fbs b/crates/re_types/definitions/rerun/archetypes/points2d.fbs index 6ae27c22fa1d..9d7dd636ec8c 100644 --- a/crates/re_types/definitions/rerun/archetypes/points2d.fbs +++ b/crates/re_types/definitions/rerun/archetypes/points2d.fbs @@ -39,29 +39,29 @@ table Points2D ( // --- Recommended --- /// Optional radii for the points, effectively turning them into circles. - radii: [rerun.components.Radius] ("attr.rerun.component_recommended", is_nullable, order: 2000); + radii: [rerun.components.Radius] ("attr.rerun.component_recommended", nullable, order: 2000); /// Optional colors for the points. /// /// \python The colors are interpreted as RGB or RGBA in sRGB gamma-space, /// \python As either 0-1 floats or 0-255 integers, with separate alpha. - colors: [rerun.components.Color] ("attr.rerun.component_recommended", is_nullable, order: 2100); + colors: [rerun.components.Color] ("attr.rerun.component_recommended", nullable, order: 2100); // --- Optional --- /// Optional text labels for the points. - labels: [rerun.components.Label] ("attr.rerun.component_optional", is_nullable, order: 3000); + labels: [rerun.components.Label] ("attr.rerun.component_optional", nullable, order: 3000); /// An optional floating point value that specifies the 2D drawing order. /// Objects with higher values are drawn on top of those with lower values. /// /// The default for 2D points is 30.0. - draw_order: rerun.components.DrawOrder ("attr.rerun.component_optional", is_nullable, order: 3100); + draw_order: rerun.components.DrawOrder ("attr.rerun.component_optional", nullable, order: 3100); /// Optional class Ids for the points. /// /// The class ID provides colors and labels if not specified explicitly. - class_ids: [rerun.components.ClassId] ("attr.rerun.component_optional", is_nullable, order: 3200); + class_ids: [rerun.components.ClassId] ("attr.rerun.component_optional", nullable, order: 3200); /// Optional keypoint IDs for the points, identifying them within a class. /// @@ -71,8 +71,8 @@ table Points2D ( /// with `class_id`). /// E.g. the classification might be 'Person' and the keypoints refer to joints on a /// detected skeleton. - keypoint_ids: [rerun.components.KeypointId] ("attr.rerun.component_optional", is_nullable, order: 3300); + keypoint_ids: [rerun.components.KeypointId] ("attr.rerun.component_optional", nullable, order: 3300); /// Unique identifiers for each individual point in the batch. - instance_keys: [rerun.components.InstanceKey] ("attr.rerun.component_optional", is_nullable, order: 3400); + instance_keys: [rerun.components.InstanceKey] ("attr.rerun.component_optional", nullable, order: 3400); } diff --git a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs index 812e3606cc4e..50cb30970122 100644 --- a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs @@ -43,32 +43,32 @@ table AffixFuzzer1 ( fuzz1112: [rerun.testing.components.AffixFuzzer12] ("attr.rerun.component_required", order: 1112); fuzz1113: [rerun.testing.components.AffixFuzzer13] ("attr.rerun.component_required", order: 1113); - fuzz2001: rerun.testing.components.AffixFuzzer1 ("attr.rerun.component_optional", is_nullable, order: 2001); - fuzz2002: rerun.testing.components.AffixFuzzer2 ("attr.rerun.component_optional", is_nullable, order: 2002); - fuzz2003: rerun.testing.components.AffixFuzzer3 ("attr.rerun.component_optional", is_nullable, order: 2003); - fuzz2004: rerun.testing.components.AffixFuzzer4 ("attr.rerun.component_optional", is_nullable, order: 2004); - fuzz2005: rerun.testing.components.AffixFuzzer5 ("attr.rerun.component_optional", is_nullable, order: 2005); - fuzz2006: rerun.testing.components.AffixFuzzer6 ("attr.rerun.component_optional", is_nullable, order: 2006); - fuzz2007: rerun.testing.components.AffixFuzzer7 ("attr.rerun.component_optional", is_nullable, order: 2007); - fuzz2008: rerun.testing.components.AffixFuzzer8 ("attr.rerun.component_optional", is_nullable, order: 2008); - fuzz2009: rerun.testing.components.AffixFuzzer9 ("attr.rerun.component_optional", is_nullable, order: 2009); - fuzz2010: rerun.testing.components.AffixFuzzer10 ("attr.rerun.component_optional", is_nullable, order: 2010); - fuzz2011: rerun.testing.components.AffixFuzzer11 ("attr.rerun.component_optional", is_nullable, order: 2011); - fuzz2012: rerun.testing.components.AffixFuzzer12 ("attr.rerun.component_optional", is_nullable, order: 2012); - fuzz2013: rerun.testing.components.AffixFuzzer13 ("attr.rerun.component_optional", is_nullable, order: 2013); + fuzz2001: rerun.testing.components.AffixFuzzer1 ("attr.rerun.component_optional", nullable, order: 2001); + fuzz2002: rerun.testing.components.AffixFuzzer2 ("attr.rerun.component_optional", nullable, order: 2002); + fuzz2003: rerun.testing.components.AffixFuzzer3 ("attr.rerun.component_optional", nullable, order: 2003); + fuzz2004: rerun.testing.components.AffixFuzzer4 ("attr.rerun.component_optional", nullable, order: 2004); + fuzz2005: rerun.testing.components.AffixFuzzer5 ("attr.rerun.component_optional", nullable, order: 2005); + fuzz2006: rerun.testing.components.AffixFuzzer6 ("attr.rerun.component_optional", nullable, order: 2006); + fuzz2007: rerun.testing.components.AffixFuzzer7 ("attr.rerun.component_optional", nullable, order: 2007); + fuzz2008: rerun.testing.components.AffixFuzzer8 ("attr.rerun.component_optional", nullable, order: 2008); + fuzz2009: rerun.testing.components.AffixFuzzer9 ("attr.rerun.component_optional", nullable, order: 2009); + fuzz2010: rerun.testing.components.AffixFuzzer10 ("attr.rerun.component_optional", nullable, order: 2010); + fuzz2011: rerun.testing.components.AffixFuzzer11 ("attr.rerun.component_optional", nullable, order: 2011); + fuzz2012: rerun.testing.components.AffixFuzzer12 ("attr.rerun.component_optional", nullable, order: 2012); + fuzz2013: rerun.testing.components.AffixFuzzer13 ("attr.rerun.component_optional", nullable, order: 2013); - fuzz2101: [rerun.testing.components.AffixFuzzer1] ("attr.rerun.component_optional", is_nullable, order: 2101); - fuzz2102: [rerun.testing.components.AffixFuzzer2] ("attr.rerun.component_optional", is_nullable, order: 2102); - fuzz2103: [rerun.testing.components.AffixFuzzer3] ("attr.rerun.component_optional", is_nullable, order: 2103); - fuzz2104: [rerun.testing.components.AffixFuzzer4] ("attr.rerun.component_optional", is_nullable, order: 2104); - fuzz2105: [rerun.testing.components.AffixFuzzer5] ("attr.rerun.component_optional", is_nullable, order: 2105); - fuzz2106: [rerun.testing.components.AffixFuzzer6] ("attr.rerun.component_optional", is_nullable, order: 2106); - fuzz2107: [rerun.testing.components.AffixFuzzer7] ("attr.rerun.component_optional", is_nullable, order: 2107); - fuzz2108: [rerun.testing.components.AffixFuzzer8] ("attr.rerun.component_optional", is_nullable, order: 2108); - fuzz2109: [rerun.testing.components.AffixFuzzer9] ("attr.rerun.component_optional", is_nullable, order: 2109); - fuzz2110: [rerun.testing.components.AffixFuzzer10] ("attr.rerun.component_optional", is_nullable, order: 2110); - fuzz2111: [rerun.testing.components.AffixFuzzer11] ("attr.rerun.component_optional", is_nullable, order: 2111); - fuzz2112: [rerun.testing.components.AffixFuzzer12] ("attr.rerun.component_optional", is_nullable, order: 2112); - fuzz2113: [rerun.testing.components.AffixFuzzer13] ("attr.rerun.component_optional", is_nullable, order: 2113); + fuzz2101: [rerun.testing.components.AffixFuzzer1] ("attr.rerun.component_optional", nullable, order: 2101); + fuzz2102: [rerun.testing.components.AffixFuzzer2] ("attr.rerun.component_optional", nullable, order: 2102); + fuzz2103: [rerun.testing.components.AffixFuzzer3] ("attr.rerun.component_optional", nullable, order: 2103); + fuzz2104: [rerun.testing.components.AffixFuzzer4] ("attr.rerun.component_optional", nullable, order: 2104); + fuzz2105: [rerun.testing.components.AffixFuzzer5] ("attr.rerun.component_optional", nullable, order: 2105); + fuzz2106: [rerun.testing.components.AffixFuzzer6] ("attr.rerun.component_optional", nullable, order: 2106); + fuzz2107: [rerun.testing.components.AffixFuzzer7] ("attr.rerun.component_optional", nullable, order: 2107); + fuzz2108: [rerun.testing.components.AffixFuzzer8] ("attr.rerun.component_optional", nullable, order: 2108); + fuzz2109: [rerun.testing.components.AffixFuzzer9] ("attr.rerun.component_optional", nullable, order: 2109); + fuzz2110: [rerun.testing.components.AffixFuzzer10] ("attr.rerun.component_optional", nullable, order: 2110); + fuzz2111: [rerun.testing.components.AffixFuzzer11] ("attr.rerun.component_optional", nullable, order: 2111); + fuzz2112: [rerun.testing.components.AffixFuzzer12] ("attr.rerun.component_optional", nullable, order: 2112); + fuzz2113: [rerun.testing.components.AffixFuzzer13] ("attr.rerun.component_optional", nullable, order: 2113); } diff --git a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs index ce7aee765e2d..4ddf8697fde8 100644 --- a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs @@ -34,7 +34,7 @@ table AffixFuzzer4 ( "attr.rust.derive": "PartialEq", order: 400 ) { - single_optional: rerun.testing.datatypes.AffixFuzzer1 (is_nullable, order: 104); + single_optional: rerun.testing.datatypes.AffixFuzzer1 (nullable, order: 104); } table AffixFuzzer5 ( @@ -42,28 +42,28 @@ table AffixFuzzer5 ( "attr.rust.tuple_struct", order: 500 ) { - single_optional: rerun.testing.datatypes.AffixFuzzer1 (is_nullable, order: 105); + single_optional: rerun.testing.datatypes.AffixFuzzer1 (nullable, order: 105); } table AffixFuzzer6 ( "attr.rust.derive": "PartialEq", order: 600 ) { - single_optional: rerun.testing.datatypes.AffixFuzzer1 (is_nullable, order: 106); + single_optional: rerun.testing.datatypes.AffixFuzzer1 (nullable, order: 106); } table AffixFuzzer7 ( "attr.rust.derive": "PartialEq", order: 700 ) { - many_optional: [rerun.testing.datatypes.AffixFuzzer1] (is_nullable, order: 107); + many_optional: [rerun.testing.datatypes.AffixFuzzer1] (nullable, order: 107); } table AffixFuzzer8 ( "attr.rust.derive": "PartialEq", order: 800 ) { - single_float_optional: float (is_nullable, order: 108); + single_float_optional: float (nullable, order: 108); } table AffixFuzzer9 ( @@ -77,14 +77,14 @@ table AffixFuzzer10 ( "attr.rust.derive": "PartialEq, Eq", order: 1000 ) { - single_string_optional: string (is_nullable, order: 110); + single_string_optional: string (nullable, order: 110); } table AffixFuzzer11 ( "attr.rust.derive": "PartialEq", order: 1100 ) { - many_floats_optional: [float] (is_nullable, order: 111); + many_floats_optional: [float] (nullable, order: 111); } table AffixFuzzer12 ( @@ -98,7 +98,7 @@ table AffixFuzzer13 ( "attr.rust.derive": "PartialEq, Eq", order: 1300 ) { - many_strings_optional: [string] (is_nullable, order: 113); + many_strings_optional: [string] (nullable, order: 113); } // TODO(cmc): the ugly bug we need to take care of at some point diff --git a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs index c075a61fee33..1948e0764493 100644 --- a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs @@ -26,12 +26,12 @@ table AffixFuzzer1 ( "attr.rust.derive": "PartialEq", order: 100 ) { - single_float_optional: float (is_nullable, order: 101); + single_float_optional: float (nullable, order: 101); single_string_required: string (order: 102); - single_string_optional: string (is_nullable, order: 103); - many_floats_optional: [float] (is_nullable, order: 104); + single_string_optional: string (nullable, order: 103); + many_floats_optional: [float] (nullable, order: 104); many_strings_required: [string] (order: 105); - many_strings_optional: [string] (is_nullable, order: 106); + many_strings_optional: [string] (nullable, order: 106); flattened_scalar: VeryDeeplyFlattenedScalar (order: 107, transparent); almost_flattened_scalar: SurprisinglyShallowScalar (order: 108, transparent); } @@ -42,5 +42,5 @@ table AffixFuzzer2 ( "attr.rust.tuple_struct", order: 200 ) { - single_float_optional: float (is_nullable, order: 101); + single_float_optional: float (nullable, order: 101); } diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index 110c8e2e9d47..442b76b83ccf 100644 --- a/crates/re_types/source_hash.txt +++ b/crates/re_types/source_hash.txt @@ -1,4 +1,4 @@ # This is a sha256 hash for all direct and indirect dependencies of this crate's build script. # It can be safely removed at anytime to force the build script to run again. # Check out build.rs to see how it's computed. -e2fe09d197c4d6639e8e0025f54510043f32bc4c269bcb772f9196027de1ff8e \ No newline at end of file +b0b0d5d6d0f4131e52331303a2c2dfdfa11e03936e97242ef897c2b158979273 \ No newline at end of file diff --git a/crates/re_types_builder/src/lib.rs b/crates/re_types_builder/src/lib.rs index cc8514a3172d..0a89555d70d9 100644 --- a/crates/re_types_builder/src/lib.rs +++ b/crates/re_types_builder/src/lib.rs @@ -138,7 +138,7 @@ pub use self::objects::{ // --- Attributes --- -pub const ATTR_IS_NULLABLE: &str = "is_nullable"; +pub const ATTR_NULLABLE: &str = "nullable"; pub const ATTR_ORDER: &str = "order"; pub const ATTR_TRANSPARENT: &str = "transparent"; diff --git a/crates/re_types_builder/src/objects.rs b/crates/re_types_builder/src/objects.rs index b16b3d11eee8..d07a0a564fce 100644 --- a/crates/re_types_builder/src/objects.rs +++ b/crates/re_types_builder/src/objects.rs @@ -661,7 +661,7 @@ impl ObjectField { let order = attrs.get::(&fqname, crate::ATTR_ORDER); let is_nullable = attrs - .try_get::(&fqname, crate::ATTR_IS_NULLABLE) + .try_get::(&fqname, crate::ATTR_NULLABLE) .is_some(); let is_deprecated = field.deprecated(); @@ -715,7 +715,7 @@ impl ObjectField { let order = attrs.get::(&fqname, crate::ATTR_ORDER); let is_nullable = attrs - .try_get::(&fqname, crate::ATTR_IS_NULLABLE) + .try_get::(&fqname, crate::ATTR_NULLABLE) .is_some(); // TODO(cmc): not sure about this, but fbs unions are a bit weird that way let is_deprecated = false;