From d48b695f85cea29c190ae517a35cb25d355ae8fe Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 6 Jul 2023 12:33:31 +0200 Subject: [PATCH 01/13] add all mising order attributes everywhere --- crates/re_types/source_hash.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index 442b76b83ccf..305d6cc97cf1 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. -b0b0d5d6d0f4131e52331303a2c2dfdfa11e03936e97242ef897c2b158979273 \ No newline at end of file +b0b0d5d6d0f4131e52331303a2c2dfdfa11e03936e97242ef897c2b158979273 From b3563ecb9fd2b16dfae1ca4e0241b5d7ac8998a2 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 6 Jul 2023 12:52:27 +0200 Subject: [PATCH 02/13] introduce 'is_nullable' semantic attribute --- crates/re_types/src/archetypes/fuzzy.rs | 2018 ++++++++--------- crates/re_types/src/archetypes/points2d.rs | 479 ++-- crates/re_types/src/components/fuzzy.rs | 280 +-- crates/re_types/src/datatypes/fuzzy.rs | 134 +- .../rerun/_rerun2/archetypes/fuzzy.py | 130 +- .../rerun/_rerun2/archetypes/points2d.py | 35 +- .../rerun/_rerun2/components/fuzzy.py | 30 +- .../rerun/_rerun2/datatypes/fuzzy.py | 21 +- 8 files changed, 1464 insertions(+), 1663 deletions(-) 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 92d070bd0bd5..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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -1054,7 +1060,7 @@ impl crate::Component for AffixFuzzer7 { 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 { @@ -1189,7 +1193,7 @@ impl crate::Component for AffixFuzzer7 { 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 { @@ -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 8498243f1c7d..c73fbbeb3f7b 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: 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, } @@ -205,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 { @@ -217,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 { @@ -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: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, 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: true, + is_nullable: false, metadata: [].into(), })), - is_nullable: true, + is_nullable: false, metadata: [].into(), }, Field { @@ -312,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(); @@ -392,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(); @@ -441,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(); @@ -492,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() @@ -615,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(); @@ -666,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() @@ -1020,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(), @@ -1055,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] @@ -1099,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(); @@ -1145,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/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 734bce377269..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,17 +197,17 @@ 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( @@ -218,7 +218,7 @@ def __init__(self) -> None: ), ] ), - 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 6a69a09ed79a..baf211917924 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(), 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(), False, {})]), False, {} @@ -141,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 e0e45503f3df45866d064f1f78131522d317e66a Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 6 Jul 2023 13:15:17 +0200 Subject: [PATCH 03/13] codegen --- 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 +- .../rerun/_rerun2/archetypes/fuzzy.py | 130 +- .../rerun/_rerun2/archetypes/points2d.py | 35 +- .../rerun/_rerun2/components/fuzzy.py | 30 +- .../rerun/_rerun2/datatypes/fuzzy.py | 21 +- 8 files changed, 1727 insertions(+), 1528 deletions(-) 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/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 ca121ae6356d6f1c386db7df9a07217d0b3238fa Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 12:43:11 +0200 Subject: [PATCH 04/13] fix bug in transparency propagation logic --- crates/re_types_builder/src/objects.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/re_types_builder/src/objects.rs b/crates/re_types_builder/src/objects.rs index d07a0a564fce..4ad3db9a49ad 100644 --- a/crates/re_types_builder/src/objects.rs +++ b/crates/re_types_builder/src/objects.rs @@ -64,12 +64,12 @@ impl Objects { let mut done = false; while !done { done = true; - let mut objects_copy = this.objects.clone(); // borrowck, the lazy way + let objects_copy = this.objects.clone(); // borrowck, the lazy way for obj in this.objects.values_mut() { for field in &mut obj.fields { if field.is_transparent() { if let Some(target_fqname) = field.typ.fqname() { - let mut target_obj = objects_copy.remove(target_fqname).unwrap(); + let mut target_obj = objects_copy[target_fqname].clone(); assert!( target_obj.fields.len() == 1, "field '{}' is marked transparent but points to object '{}' which \ From f440ee906c8f96a4131a759743790f327f9791f7 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 12:53:03 +0200 Subject: [PATCH 05/13] add semantic support for unions and arrays of unions --- crates/re_types_builder/src/objects.rs | 28 +++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/crates/re_types_builder/src/objects.rs b/crates/re_types_builder/src/objects.rs index 4ad3db9a49ad..dd0920fea003 100644 --- a/crates/re_types_builder/src/objects.rs +++ b/crates/re_types_builder/src/objects.rs @@ -125,6 +125,24 @@ impl Objects { .filter(|(_, obj)| !obj.is_transparent()) .collect(); + // Check for nullable unions -- these cannot be represented in Arrow! + for obj in this.objects.values() { + for field in &obj.fields { + if !field.is_nullable { + continue; + } + + if let Type::Object(fqname) = &field.typ { + let target = &this.objects[fqname]; + assert!( + !(target.is_enum() || target.is_union()), + "nullable unions cannot be represented in Arrow, found one at {:?}", + field.fqname, + ); + } + } + } + this } } @@ -411,6 +429,7 @@ impl Object { .iter() // NOTE: These are intermediate fields used by flatbuffers internals, we don't care. .filter(|field| field.type_().base_type() != FbsBaseType::UType) + .filter(|field| field.type_().element() != FbsBaseType::UType) .map(|field| { ObjectField::from_raw_object_field(include_dir_path, enums, objs, obj, &field) }) @@ -923,7 +942,7 @@ pub enum ElementType { impl ElementType { pub fn from_raw_base_type( - _enums: &[FbsEnum<'_>], + enums: &[FbsEnum<'_>], objs: &[FbsObject<'_>], outer_type: FbsType<'_>, inner_type: FbsBaseType, @@ -946,12 +965,15 @@ impl ElementType { let obj = &objs[outer_type.index() as usize]; Self::Object(obj.name().to_owned()) } - FbsBaseType::Union => unimplemented!("{inner_type:#?}"), // NOLINT + FbsBaseType::Union => { + let enm = &enums[outer_type.index() as usize]; + Self::Object(enm.name().to_owned()) + } FbsBaseType::None | FbsBaseType::UType | FbsBaseType::Array | FbsBaseType::Vector - | FbsBaseType::Vector64 => unreachable!("{inner_type:#?}"), + | FbsBaseType::Vector64 => unreachable!("{outer_type:#?} into {inner_type:#?}"), // NOTE: `FbsType` isn't actually an enum, it's just a bunch of constants... _ => unreachable!("{inner_type:#?}"), } From 1f06a939ee5ab12cc86b7000e59fb6c162f1660e Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 13:16:22 +0200 Subject: [PATCH 06/13] fix Rust enum definition codegen --- crates/re_types_builder/src/codegen/rust.rs | 47 ++++++++++++--------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/crates/re_types_builder/src/codegen/rust.rs b/crates/re_types_builder/src/codegen/rust.rs index 8e0ec4ac0ecb..f7c2769d53ff 100644 --- a/crates/re_types_builder/src/codegen/rust.rs +++ b/crates/re_types_builder/src/codegen/rust.rs @@ -251,7 +251,7 @@ impl QuotedObject { let quoted_struct = if is_tuple_struct { quote! { pub struct #name(#(#quoted_fields,)*); } } else { - quote! { pub struct #name { #(#quoted_fields,)* } } + quote! { pub struct #name { #(#quoted_fields,)* }} }; let quoted_trait_impls = quote_trait_impls_from_obj(arrow_registry, objects, obj); @@ -315,15 +315,21 @@ impl QuotedObject { typ: _, attrs: _, order: _, - is_nullable: _, + is_nullable, is_deprecated: _, datatype: _, } = obj_field; - let name = format_ident!("{name}"); + use convert_case::{Case, Casing}; + let name = format_ident!("{}", name.to_case(Case::UpperCamel)); let quoted_doc = quote_doc_from_docs(docs); let (quoted_type, _) = quote_field_type_from_field(obj_field, false); + let quoted_type = if *is_nullable { + quote!(Option<#quoted_type>) + } else { + quoted_type + }; quote! { #quoted_doc @@ -974,7 +980,7 @@ impl quote::ToTokens for ArrowDataTypeTokenizer<'_> { UnionMode::Dense => quote!(UnionMode::Dense), UnionMode::Sparse => quote!(UnionMode::Sparse), }; - quote!(DataType::Union(#(#fields,)*, None, #mode)) + quote!(DataType::Union(vec![ #(#fields,)* ], None, #mode)) } DataType::Struct(fields) => { @@ -1132,7 +1138,7 @@ fn quote_arrow_serializer( let quoted_flatten = quoted_flatten(obj_field.is_nullable); - quote! { { + quote! {{ let (somes, #quoted_data_dst): (Vec<_>, Vec<_>) = #quoted_data_src .into_iter() .map(|datum| { @@ -1153,7 +1159,7 @@ fn quote_arrow_serializer( #quoted_bitmap; #quoted_serializer - } } + }} } else { let data_src = data_src.clone(); @@ -1176,7 +1182,7 @@ fn quote_arrow_serializer( let quoted_bitmap = quoted_bitmap(bitmap_dst); - quote! { { + quote! {{ let (somes, #data_dst): (Vec<_>, Vec<_>) = #data_src .iter() .map(|datum| { @@ -1196,12 +1202,12 @@ fn quote_arrow_serializer( #quoted_bitmap; #quoted_serializer - } } + }} }); let quoted_bitmap = quoted_bitmap(format_ident!("bitmap")); - quote! { { + quote! {{ let (somes, #data_src): (Vec<_>, Vec<_>) = #data_src .into_iter() .map(|datum| { @@ -1217,7 +1223,8 @@ fn quote_arrow_serializer( vec![#(#quoted_field_serializers,)*], bitmap, ).boxed() - } } + }} + } } _ => unimplemented!("{datatype:#?}"), // NOLINT } @@ -1269,7 +1276,7 @@ fn quote_arrow_field_serializer( } DataType::Utf8 => { - quote! { { + quote! {{ // NOTE: Flattening to remove the guaranteed layer of nullability: we don't care // about it while building the backing buffer since it's all offsets driven. let inner_data: ::arrow2::buffer::Buffer = #data_src.iter().flatten().flat_map(|s| s.bytes()).collect(); @@ -1282,7 +1289,7 @@ fn quote_arrow_field_serializer( // whole utf8 validation _again_. #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { Utf8Array::::new_unchecked(#quoted_datatype, offsets, inner_data, #bitmap_src) }.boxed() - } } + }} } DataType::List(inner) | DataType::FixedSizeList(inner, _) => { @@ -1325,7 +1332,7 @@ fn quote_arrow_field_serializer( // TODO(cmc): We should be checking this, but right now we don't because we don't // support intra-list nullability. _ = is_nullable; - quote! { { + quote! {{ use arrow2::{buffer::Buffer, offset::OffsetsBuffer}; let #quoted_inner_data: Vec<_> = #data_src @@ -1347,7 +1354,7 @@ fn quote_arrow_field_serializer( }; #quoted_create - } } + }} } DataType::Struct(_) => { @@ -1471,7 +1478,7 @@ fn quote_arrow_deserializer( } }); - quote! { { + quote! {{ let #data_src = #data_src .as_any() .downcast_ref::<::arrow2::array::StructArray>() @@ -1500,7 +1507,7 @@ fn quote_arrow_deserializer( })).transpose()) // NOTE: implicit Vec to Result .collect::>>()? - } } + }} } _ => unimplemented!("{datatype:#?}"), // NOLINT } @@ -1555,7 +1562,7 @@ fn quote_arrow_field_deserializer( let quoted_inner = quote_arrow_field_deserializer(inner_datatype, inner.is_nullable, data_src); - quote! { { + quote! {{ let datatype = #data_src.data_type(); let #data_src = #data_src .as_any() @@ -1595,7 +1602,7 @@ fn quote_arrow_field_deserializer( // NOTE: implicit Vec to Result .collect::>>>()? .into_iter() - } } + }} } DataType::List(inner) => { @@ -1605,7 +1612,7 @@ fn quote_arrow_field_deserializer( let quoted_inner = quote_arrow_field_deserializer(inner_datatype, inner.is_nullable, data_src); - quote! { { + quote! {{ let datatype = #data_src.data_type(); let #data_src = #data_src .as_any() @@ -1643,7 +1650,7 @@ fn quote_arrow_field_deserializer( // NOTE: implicit Vec to Result .collect::>>>()? .into_iter() - } } + }} } DataType::Struct(_) => { From d2325276b9c57f08fd842b70ad861a52a674f73b Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 13:16:50 +0200 Subject: [PATCH 07/13] implement enum serialization in rust backend --- crates/re_types_builder/src/codegen/rust.rs | 119 +++++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/crates/re_types_builder/src/codegen/rust.rs b/crates/re_types_builder/src/codegen/rust.rs index f7c2769d53ff..97e8d07d0e51 100644 --- a/crates/re_types_builder/src/codegen/rust.rs +++ b/crates/re_types_builder/src/codegen/rust.rs @@ -1225,6 +1225,123 @@ fn quote_arrow_serializer( ).boxed() }} } + DataType::Union(_, _, arrow2::datatypes::UnionMode::Dense) => { + let quoted_field_serializers = obj.fields.iter().map(|obj_field| { + let data_dst = format_ident!("{}", obj_field.name); + let bitmap_dst = format_ident!("{data_dst}_bitmap"); + + let quoted_serializer = quote_arrow_field_serializer( + None, + &arrow_registry.get(&obj_field.fqname), + obj_field.is_nullable, + &bitmap_dst, + &data_dst, + ); + + let quoted_flatten = quoted_flatten(obj_field.is_nullable); + let quoted_bitmap = quoted_bitmap(bitmap_dst); + + let quoted_obj_name = format_ident!("{}", obj.name); + let quoted_obj_field_name = { + use convert_case::{Case, Casing}; + format_ident!("{}", obj_field.name.to_case(Case::UpperCamel)) + }; + + quote! {{ + let (somes, #data_dst): (Vec<_>, Vec<_>) = #data_src + .iter() + .flatten() // NOTE: unions cannot ever be nullable at top-level + .filter(|datum| matches!(***datum, #quoted_obj_name::#quoted_obj_field_name(_))) + .map(|datum| { + let datum = match &**datum { + #quoted_obj_name::#quoted_obj_field_name(v) => Some(v.clone()), + _ => None, + } #quoted_flatten ; + + (datum.is_some(), datum) + }) + .unzip(); + + + #quoted_bitmap; + + #quoted_serializer + }} + }); + + let quoted_types = { + let quoted_obj_name = format_ident!("{}", obj.name); + let quoted_branches = obj.fields.iter().enumerate().map(|(i, obj_field)| { + let i = i as i8; + let quoted_obj_field_name = { + use convert_case::{Case, Casing}; + format_ident!("{}", obj_field.name.to_case(Case::UpperCamel)) + }; + quote!(#quoted_obj_name::#quoted_obj_field_name(_) => #i) + }); + + quote! {{ + #data_src + .iter() + .flatten() + .map(|v| match **v { + #(#quoted_branches,)* + }) + .collect() + }} + }; + + let quoted_offsets = { + let quoted_obj_name = format_ident!("{}", obj.name); + + let quoted_counters = obj.fields.iter().map(|obj_field| { + let quoted_obj_field_name = format_ident!("{}_offset", obj_field.name); + quote!(let mut #quoted_obj_field_name = 0) + }); + + let quoted_branches = obj.fields.iter().map(|obj_field| { + let quoted_counter_name = format_ident!("{}_offset", obj_field.name); + let quoted_obj_field_name = { + use convert_case::{Case, Casing}; + format_ident!("{}", obj_field.name.to_case(Case::UpperCamel)) + }; + quote! { + #quoted_obj_name::#quoted_obj_field_name(_) => { + let offset = #quoted_counter_name; + #quoted_counter_name += 1; + offset + } + } + }); + + quote! {{ + #(#quoted_counters;)* + #data_src + .iter() + .flatten() + .map(|v| match **v { + #(#quoted_branches,)* + }) + .collect() + }} + }; + + quote! {{ + let #data_src: Vec<_> = #data_src + .into_iter() + .map(|datum| { + let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); + datum + }) + .collect(); + + UnionArray::new( + #quoted_datatype, + #quoted_types, + vec![#(#quoted_field_serializers,)*], + Some(#quoted_offsets), + ).boxed() + }} } _ => unimplemented!("{datatype:#?}"), // NOLINT } @@ -1357,7 +1474,7 @@ fn quote_arrow_field_serializer( }} } - DataType::Struct(_) => { + DataType::Struct(_) | DataType::Union(_, _, _) => { // NOTE: We always wrap objects with full extension metadata. let DataType::Extension(fqname, _, _) = datatype else { unreachable!() }; let fqname_use = quote_fqname_as_type_path(fqname); From bf2f81115231d0d98f73600a03a6e779e6938760 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 13:17:03 +0200 Subject: [PATCH 08/13] implement enum deserialization in rust backend --- crates/re_types_builder/src/codegen/rust.rs | 87 ++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/crates/re_types_builder/src/codegen/rust.rs b/crates/re_types_builder/src/codegen/rust.rs index 97e8d07d0e51..60c047109305 100644 --- a/crates/re_types_builder/src/codegen/rust.rs +++ b/crates/re_types_builder/src/codegen/rust.rs @@ -1626,6 +1626,91 @@ fn quote_arrow_deserializer( .collect::>>()? }} } + + DataType::Union(_, _, arrow2::datatypes::UnionMode::Dense) => { + let data_src_types = format_ident!("{data_src}_types"); + let data_src_arrays = format_ident!("{data_src}_arrays"); + let data_src_offsets = format_ident!("{data_src}_offsets"); + + let quoted_field_deserializers = + obj.fields.iter().enumerate().map(|(i, obj_field)| { + let data_dst = format_ident!("{}", obj_field.name); + + let quoted_deserializer = quote_arrow_field_deserializer( + &arrow_registry.get(&obj_field.fqname), + obj_field.is_nullable, + &data_src, + ); + + quote! { + let #data_dst = { + let #data_src = &*#data_src_arrays[#i]; + #quoted_deserializer.collect::>() + } + } + }); + + let quoted_obj_name = format_ident!("{}", obj.name); + let quoted_branches = obj.fields.iter().enumerate().map(|(i, obj_field)| { + let i = i as i8; + let quoted_obj_field_name = format_ident!("{}", obj_field.name); + let quoted_obj_field_type = { + use convert_case::{Case, Casing}; + format_ident!("{}", obj_field.name.to_case(Case::UpperCamel)) + }; + + let quoted_unwrap = if obj_field.is_nullable { + quote!() + } else { + quote!(.unwrap()) + }; + + quote! { + #i => #quoted_obj_name::#quoted_obj_field_type( + #quoted_obj_field_name + .get(offset as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (offset as usize, offset as usize), + len: #quoted_obj_field_name.len(), + datatype: #data_src.data_type().clone(), + })? + .clone() + #quoted_unwrap + ) + } + }); + + quote! {{ + let #data_src = #data_src + .as_any() + .downcast_ref::<::arrow2::array::UnionArray>() + .ok_or_else(|| crate::DeserializationError::SchemaMismatch { + expected: #data_src.data_type().clone(), + got: #data_src.data_type().clone(), + })?; + + let (#data_src_types, #data_src_arrays, #data_src_offsets) = + // NOTE: unwrapping of offsets is safe because this is a dense union + (#data_src.types(), #data_src.fields(), #data_src.offsets().unwrap()); + + #(#quoted_field_deserializers;)* + + #data_src_types + .iter() + .enumerate() + .map(|(i, typ)| { + let offset = #data_src_offsets[i]; + + Ok(Some(match typ { + #(#quoted_branches,)* + _ => unreachable!(), + })) + }) + // NOTE: implicit Vec to Result + .collect::>>()? + }} + } + _ => unimplemented!("{datatype:#?}"), // NOLINT } } @@ -1770,7 +1855,7 @@ fn quote_arrow_field_deserializer( }} } - DataType::Struct(_) => { + DataType::Struct(_) | DataType::Union(_, _, _) => { let DataType::Extension(fqname, _, _) = datatype else { unreachable!() }; let fqname_use = quote_fqname_as_type_path(fqname); quote!(#fqname_use::try_from_arrow_opt(#data_src)?.into_iter()) From c6b5acf2587d89397195eddc353d671ea8ea159d Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 13:17:37 +0200 Subject: [PATCH 09/13] add definitions for union fuzzing test cases --- .../rerun/testing/archetypes/fuzzy.fbs | 13 ++++++- .../rerun/testing/components/fuzzy.fbs | 38 ++++++++++++++++++- .../rerun/testing/datatypes/fuzzy.fbs | 32 +++++++++++++++- 3 files changed, 80 insertions(+), 3 deletions(-) diff --git a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs index 50cb30970122..338bdf4023bf 100644 --- a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs @@ -28,6 +28,12 @@ table AffixFuzzer1 ( 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); + fuzz1014: rerun.testing.components.AffixFuzzer14 ("attr.rerun.component_required", order: 1014); + // NOTE: nullable union -- illegal! + // fuzz1015: rerun.testing.components.AffixFuzzer15 ("attr.rerun.component_required", order: 1015); + fuzz1016: rerun.testing.components.AffixFuzzer16 ("attr.rerun.component_required", order: 1016); + fuzz1017: rerun.testing.components.AffixFuzzer17 ("attr.rerun.component_required", order: 1017); + fuzz1018: rerun.testing.components.AffixFuzzer18 ("attr.rerun.component_required", order: 1018); fuzz1101: [rerun.testing.components.AffixFuzzer1] ("attr.rerun.component_required", order: 1101); fuzz1102: [rerun.testing.components.AffixFuzzer2] ("attr.rerun.component_required", order: 1102); @@ -42,6 +48,12 @@ table AffixFuzzer1 ( 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); + fuzz1114: [rerun.testing.components.AffixFuzzer14] ("attr.rerun.component_required", order: 1114); + // NOTE: nullable union -- illegal! + // fuzz1115: [rerun.testing.components.AffixFuzzer15] ("attr.rerun.component_required", order: 1115); + fuzz1116: [rerun.testing.components.AffixFuzzer16] ("attr.rerun.component_required", order: 1116); + fuzz1117: [rerun.testing.components.AffixFuzzer17] ("attr.rerun.component_required", order: 1117); + fuzz1118: [rerun.testing.components.AffixFuzzer18] ("attr.rerun.component_required", order: 1118); fuzz2001: rerun.testing.components.AffixFuzzer1 ("attr.rerun.component_optional", nullable, order: 2001); fuzz2002: rerun.testing.components.AffixFuzzer2 ("attr.rerun.component_optional", nullable, order: 2002); @@ -71,4 +83,3 @@ table AffixFuzzer1 ( 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 4ddf8697fde8..c92069ecb40d 100644 --- a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs @@ -101,11 +101,47 @@ table AffixFuzzer13 ( many_strings_optional: [string] (nullable, order: 113); } +table AffixFuzzer14 ( + "attr.rust.derive": "PartialEq", + order: 1400 +) { + single_required_union: rerun.testing.datatypes.AffixFuzzer3 (order: 114); +} + +// NOTE: Illegal: union don't have top-level bitmaps! Commenting out will/should break the build. +// table AffixFuzzer15 ( +// "attr.rust.derive": "PartialEq", +// order: 1500 +// ) { +// single_optional_union: rerun.testing.datatypes.AffixFuzzer3 (is_nullable, order: 115); +// } + +table AffixFuzzer16 ( + "attr.rust.derive": "PartialEq", + order: 1600 +) { + many_required_unions: [rerun.testing.datatypes.AffixFuzzer3] (order: 116); +} + +table AffixFuzzer17 ( + "attr.rust.derive": "PartialEq", + order: 1700 +) { + many_optional_unions: [rerun.testing.datatypes.AffixFuzzer3] (is_nullable, order: 117); +} + +table AffixFuzzer18 ( + "attr.rust.derive": "PartialEq", + order: 1800 +) { + many_optional_unions: [rerun.testing.datatypes.AffixFuzzer4] (is_nullable, order: 118); +} + // TODO(cmc): the ugly bug we need to take care of at some point // table AffixFuzzer14 ( // "attr.rust.derive": "PartialEq", // order: 1400 // ) { // -// many_transparent_optionals: rerun.testing.datatypes.AffixFuzzer2 (order: 107); +// many_transparent_optionals: rerun.testing.datatypes.AffixFuzzer2 (is_nullable, order: 107); // } diff --git a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs index 1948e0764493..9daf9c9a91c0 100644 --- a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs @@ -19,7 +19,7 @@ table VeryDeeplyFlattenedScalar (transparent, order: 001) { } table SurprisinglyShallowScalar (transparent, order: 001) { - value: FlattenedScalar (required, order: 100); + value: FlattenedScalar (order: 100); } table AffixFuzzer1 ( @@ -36,6 +36,10 @@ table AffixFuzzer1 ( almost_flattened_scalar: SurprisinglyShallowScalar (order: 108, transparent); } +table __AffixFuzzer1Vec (transparent, order: 0) { + inner: [AffixFuzzer1] (order: 0); +} + table AffixFuzzer2 ( "attr.arrow.transparent", "attr.rust.derive": "PartialEq", @@ -44,3 +48,29 @@ table AffixFuzzer2 ( ) { single_float_optional: float (nullable, order: 101); } + +union AffixFuzzer3 ( + "attr.rust.derive": "PartialEq", + order: 300 +) { + degrees: FlattenedScalar (transparent, order: 100), + radians: FlattenedScalar (transparent, is_nullable, order: 101), + craziness: __AffixFuzzer1Vec (transparent, order: 102), +} + +table __AffixFuzzer3 (transparent, order: 0) { + inner: AffixFuzzer3 (order: 0); +} + +table __AffixFuzzer3Vec (transparent, order: 0) { + inner: [AffixFuzzer3] (order: 0); +} + +union AffixFuzzer4 ( + "attr.rust.derive": "PartialEq", + order: 300 +) { + single_required: __AffixFuzzer3 (transparent, order: 100), + many_required: __AffixFuzzer3Vec (transparent, order: 101), + many_optional: __AffixFuzzer3Vec (transparent, order: 102, is_nullable), +} From e11f0b633add921058e64892fa5f137faa4d1d62 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 13:17:46 +0200 Subject: [PATCH 10/13] impl fuzzy test cases for unions --- crates/re_types/tests/fuzzy.rs | 128 ++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 2 deletions(-) diff --git a/crates/re_types/tests/fuzzy.rs b/crates/re_types/tests/fuzzy.rs index 3e471b2dbd7c..7eec20965400 100644 --- a/crates/re_types/tests/fuzzy.rs +++ b/crates/re_types/tests/fuzzy.rs @@ -1,6 +1,6 @@ #![allow(clippy::redundant_clone)] -use std::collections::HashMap; +use std::{collections::HashMap, f32::consts::PI}; use re_types::{archetypes::AffixFuzzer1, Archetype as _}; @@ -143,6 +143,107 @@ fn roundtrip() { ]), }; + let fuzzy14_1 = re_types::components::AffixFuzzer14 { + single_required_union: re_types::datatypes::AffixFuzzer3::Degrees(90.0), + }; + let fuzzy14_2 = re_types::components::AffixFuzzer14 { + single_required_union: re_types::datatypes::AffixFuzzer3::Radians(Some(PI)), + }; + let fuzzy14_3 = re_types::components::AffixFuzzer14 { + single_required_union: re_types::datatypes::AffixFuzzer3::Radians(None), + }; + + // NOTE: nullable union -- illegal! + // let fuzzy15_1 = re_types::components::AffixFuzzer15 { + // single_optional_union: None, + // }; + // let fuzzy15_2 = re_types::components::AffixFuzzer15 { + // single_optional_union: Some(re_types::datatypes::AffixFuzzer3::Radians(PI / 4.0)), + // }; + + let fuzzy16_1 = re_types::components::AffixFuzzer16 { + many_required_unions: vec![ + re_types::datatypes::AffixFuzzer3::Radians(None), // + re_types::datatypes::AffixFuzzer3::Degrees(45.0), // + re_types::datatypes::AffixFuzzer3::Radians(Some(PI * 2.0)), // + ], + }; + let fuzzy16_2 = re_types::components::AffixFuzzer16 { + many_required_unions: vec![ + re_types::datatypes::AffixFuzzer3::Degrees(20.0), // + re_types::datatypes::AffixFuzzer3::Degrees(30.0), // + re_types::datatypes::AffixFuzzer3::Radians(Some(0.424242)), // + ], + }; + + let fuzzy17_1 = re_types::components::AffixFuzzer17 { + many_optional_unions: None, + }; + let fuzzy17_2 = re_types::components::AffixFuzzer17 { + many_optional_unions: Some(vec![ + re_types::datatypes::AffixFuzzer3::Degrees(20.0), // + re_types::datatypes::AffixFuzzer3::Degrees(30.0), // + re_types::datatypes::AffixFuzzer3::Radians(None), // + ]), + }; + + let fuzzy18_1 = re_types::components::AffixFuzzer18 { + many_optional_unions: None, + }; + let fuzzy18_2 = re_types::components::AffixFuzzer18 { + many_optional_unions: Some(vec![ + re_types::datatypes::AffixFuzzer4::SingleRequired( + re_types::datatypes::AffixFuzzer3::Craziness(vec![ + re_types::datatypes::AffixFuzzer1 { + single_float_optional: None, + single_string_required: "d".into(), + single_string_optional: None, + many_floats_optional: Some(vec![4.0, 40.0, 400.0]), + many_strings_required: vec!["7".into(), "8".into()], + many_strings_optional: None, + flattened_scalar: 46.0, + almost_flattened_scalar: re_types::datatypes::FlattenedScalar { + value: 46.0, + }, + }, + ]), + ), // + re_types::datatypes::AffixFuzzer4::SingleRequired( + re_types::datatypes::AffixFuzzer3::Degrees(30.0), + ), // + re_types::datatypes::AffixFuzzer4::SingleRequired( + re_types::datatypes::AffixFuzzer3::Radians(None), + ), // + ]), + }; + let fuzzy18_3 = re_types::components::AffixFuzzer18 { + many_optional_unions: Some(vec![ + re_types::datatypes::AffixFuzzer4::ManyRequired(vec![ + re_types::datatypes::AffixFuzzer3::Radians(None), // + re_types::datatypes::AffixFuzzer3::Degrees(45.0), // + re_types::datatypes::AffixFuzzer3::Radians(Some(PI * 2.0)), // + re_types::datatypes::AffixFuzzer3::Craziness(vec![ + re_types::datatypes::AffixFuzzer1 { + single_float_optional: Some(3.0), + single_string_required: "c".into(), + single_string_optional: Some("c".into()), + many_floats_optional: Some(vec![3.0, 30.0, 300.0]), + 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: 44.0, + }, + }, + ]), + ]), // + re_types::datatypes::AffixFuzzer4::ManyOptional(Some(vec![ + re_types::datatypes::AffixFuzzer3::Radians(None), + ])), // + re_types::datatypes::AffixFuzzer4::ManyOptional(None), // + ]), + }; + let arch = AffixFuzzer1::new( fuzzy1.clone(), fuzzy2.clone(), @@ -157,6 +258,11 @@ fn roundtrip() { fuzzy11_1.clone(), fuzzy12_1.clone(), fuzzy13_1.clone(), + fuzzy14_2.clone(), + // fuzzy15_1.clone(), + fuzzy16_2.clone(), + fuzzy17_2.clone(), + fuzzy18_2.clone(), [fuzzy1.clone(), fuzzy1.clone(), fuzzy1.clone()], [fuzzy2.clone(), fuzzy2.clone(), fuzzy2.clone()], [fuzzy3.clone(), fuzzy3.clone(), fuzzy3.clone()], @@ -170,16 +276,34 @@ fn roundtrip() { [fuzzy11_1.clone(), fuzzy11_2.clone(), fuzzy11_1.clone()], [fuzzy12_1.clone(), fuzzy12_2.clone(), fuzzy12_1.clone()], [fuzzy13_1.clone(), fuzzy13_2.clone(), fuzzy13_1.clone()], + [fuzzy14_1.clone(), fuzzy14_2.clone(), fuzzy14_3.clone()], + // [fuzzy15_1.clone(), fuzzy15_2.clone(), fuzzy15_1.clone()], + [fuzzy16_1.clone(), fuzzy16_2.clone(), fuzzy16_1.clone()], + [fuzzy17_1.clone(), fuzzy17_2.clone(), fuzzy17_1.clone()], + [fuzzy18_1.clone(), fuzzy18_2.clone(), fuzzy18_3.clone()], ) .with_fuzz2001(fuzzy1.clone()) .with_fuzz2003(fuzzy3.clone()) .with_fuzz2005(fuzzy5.clone()) + .with_fuzz2007(fuzzy7_1.clone()) + .with_fuzz2009(fuzzy9_1.clone()) + .with_fuzz2011(fuzzy11_1.clone()) + .with_fuzz2013(fuzzy13_1.clone()) + .with_fuzz2014(fuzzy14_3.clone()) + // .with_fuzz2015(fuzzy15_1.clone()) + .with_fuzz2016(fuzzy16_1.clone()) + .with_fuzz2017(fuzzy17_1.clone()) + .with_fuzz2018(fuzzy18_1.clone()) .with_fuzz2102([fuzzy2.clone(), fuzzy2.clone(), fuzzy2.clone()]) .with_fuzz2104([fuzzy4.clone(), fuzzy4.clone(), fuzzy4.clone()]) .with_fuzz2106([fuzzy6.clone(), fuzzy6.clone(), fuzzy6.clone()]) .with_fuzz2108([fuzzy8_1.clone(), fuzzy8_2.clone(), fuzzy8_1.clone()]) .with_fuzz2110([fuzzy10_1.clone(), fuzzy10_2.clone(), fuzzy10_1.clone()]) - .with_fuzz2112([fuzzy12_1.clone(), fuzzy12_2.clone(), fuzzy12_1.clone()]); + .with_fuzz2112([fuzzy12_1.clone(), fuzzy12_2.clone(), fuzzy12_1.clone()]) + .with_fuzz2114([fuzzy14_1.clone(), fuzzy14_2.clone(), fuzzy14_3.clone()]) + .with_fuzz2116([fuzzy16_1.clone(), fuzzy16_2.clone(), fuzzy16_1.clone()]) + .with_fuzz2117([fuzzy17_1.clone(), fuzzy17_2.clone(), fuzzy17_1.clone()]) + .with_fuzz2118([fuzzy18_1.clone(), fuzzy18_2.clone(), fuzzy18_3.clone()]); #[rustfmt::skip] let expected_extensions: HashMap<_, _> = [ From 4a31d416160e823e2775d2706927ecf05a4b85cd Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 13:18:00 +0200 Subject: [PATCH 11/13] codegen --- crates/re_types/src/archetypes/fuzzy.rs | 682 +++++- crates/re_types/src/components/fuzzy.rs | 2130 +++++++++++++++++ crates/re_types/src/components/mod.rs | 6 +- crates/re_types/src/datatypes/fuzzy.rs | 1797 ++++++++++++++ crates/re_types/src/datatypes/mod.rs | 2 +- .../rerun/_rerun2/archetypes/fuzzy.py | 72 + .../rerun/_rerun2/components/__init__.py | 34 + .../rerun/_rerun2/components/fuzzy.py | 480 ++++ .../rerun/_rerun2/datatypes/__init__.py | 20 + .../rerun/_rerun2/datatypes/fuzzy.py | 323 +++ 10 files changed, 5539 insertions(+), 7 deletions(-) diff --git a/crates/re_types/src/archetypes/fuzzy.rs b/crates/re_types/src/archetypes/fuzzy.rs index 22609bed9f1b..5fe8cdac0154 100644 --- a/crates/re_types/src/archetypes/fuzzy.rs +++ b/crates/re_types/src/archetypes/fuzzy.rs @@ -24,6 +24,10 @@ pub struct AffixFuzzer1 { pub fuzz1011: crate::components::AffixFuzzer11, pub fuzz1012: crate::components::AffixFuzzer12, pub fuzz1013: crate::components::AffixFuzzer13, + pub fuzz1014: crate::components::AffixFuzzer14, + pub fuzz1016: crate::components::AffixFuzzer16, + pub fuzz1017: crate::components::AffixFuzzer17, + pub fuzz1018: crate::components::AffixFuzzer18, pub fuzz1101: Vec, pub fuzz1102: Vec, pub fuzz1103: Vec, @@ -37,6 +41,10 @@ pub struct AffixFuzzer1 { pub fuzz1111: Vec, pub fuzz1112: Vec, pub fuzz1113: Vec, + pub fuzz1114: Vec, + pub fuzz1116: Vec, + pub fuzz1117: Vec, + pub fuzz1118: Vec, pub fuzz2001: Option, pub fuzz2002: Option, pub fuzz2003: Option, @@ -50,6 +58,10 @@ pub struct AffixFuzzer1 { pub fuzz2011: Option, pub fuzz2012: Option, pub fuzz2013: Option, + pub fuzz2014: Option, + pub fuzz2016: Option, + pub fuzz2017: Option, + pub fuzz2018: Option, pub fuzz2101: Option>, pub fuzz2102: Option>, pub fuzz2103: Option>, @@ -63,10 +75,14 @@ pub struct AffixFuzzer1 { pub fuzz2111: Option>, pub fuzz2112: Option>, pub fuzz2113: Option>, + pub fuzz2114: Option>, + pub fuzz2116: Option>, + pub fuzz2117: Option>, + pub fuzz2118: Option>, } impl AffixFuzzer1 { - pub const REQUIRED_COMPONENTS: [crate::ComponentName; 26usize] = [ + pub const REQUIRED_COMPONENTS: [crate::ComponentName; 34usize] = [ crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer1"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer2"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer3"), @@ -80,6 +96,10 @@ impl AffixFuzzer1 { crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer11"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer12"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer13"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer1"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer2"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer3"), @@ -93,11 +113,15 @@ impl AffixFuzzer1 { crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer11"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer12"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer13"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18"), ]; pub const RECOMMENDED_COMPONENTS: [crate::ComponentName; 0usize] = []; - pub const OPTIONAL_COMPONENTS: [crate::ComponentName; 26usize] = [ + pub const OPTIONAL_COMPONENTS: [crate::ComponentName; 34usize] = [ crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer1"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer2"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer3"), @@ -111,6 +135,10 @@ impl AffixFuzzer1 { crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer11"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer12"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer13"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer1"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer2"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer3"), @@ -124,9 +152,13 @@ impl AffixFuzzer1 { crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer11"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer12"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer13"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18"), ]; - pub const ALL_COMPONENTS: [crate::ComponentName; 52usize] = [ + pub const ALL_COMPONENTS: [crate::ComponentName; 68usize] = [ crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer1"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer2"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer3"), @@ -140,6 +172,10 @@ impl AffixFuzzer1 { crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer11"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer12"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer13"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer1"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer2"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer3"), @@ -153,6 +189,10 @@ impl AffixFuzzer1 { crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer11"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer12"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer13"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer1"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer2"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer3"), @@ -166,6 +206,10 @@ impl AffixFuzzer1 { crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer11"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer12"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer13"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer1"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer2"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer3"), @@ -179,6 +223,10 @@ impl AffixFuzzer1 { crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer11"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer12"), crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer13"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17"), + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18"), ]; } @@ -445,6 +493,78 @@ impl crate::Archetype for AffixFuzzer1 { }) .transpose()? }, + { + Some({ + let array = + ::try_to_arrow([&self.fuzz1014], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer14".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer14".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz1014", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + Some({ + let array = + ::try_to_arrow([&self.fuzz1016], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer16".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer16".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz1016", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + Some({ + let array = + ::try_to_arrow([&self.fuzz1017], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer17".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer17".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz1017", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + Some({ + let array = + ::try_to_arrow([&self.fuzz1018], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer18".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer18".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz1018", datatype, false), + array, + ) + }) + }) + .transpose()? + }, { Some({ let array = @@ -687,6 +807,86 @@ impl crate::Archetype for AffixFuzzer1 { }) .transpose()? }, + { + Some({ + let array = ::try_to_arrow( + self.fuzz1114.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer14".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer14".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz1114", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + Some({ + let array = ::try_to_arrow( + self.fuzz1116.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer16".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer16".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz1116", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + Some({ + let array = ::try_to_arrow( + self.fuzz1117.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer17".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer17".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz1117", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + Some({ + let array = ::try_to_arrow( + self.fuzz1118.iter(), + None, + ); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer18".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer18".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz1118", datatype, false), + array, + ) + }) + }) + .transpose()? + }, { self.fuzz2001 .as_ref() @@ -938,6 +1138,86 @@ impl crate::Archetype for AffixFuzzer1 { }) .transpose()? }, + { + self.fuzz2014 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer14".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer14".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2014", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2016 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer16".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer16".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2016", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2017 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer17".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer17".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2017", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2018 + .as_ref() + .map(|single| { + let array = + ::try_to_arrow([single], None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer18".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer18".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2018", datatype, false), + array, + ) + }) + }) + .transpose()? + }, { self.fuzz2101 .as_ref() @@ -1198,6 +1478,86 @@ impl crate::Archetype for AffixFuzzer1 { }) .transpose()? }, + { + self.fuzz2114 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer14".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer14".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2114", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2116 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer16".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer16".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2116", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2117 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer17".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer17".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2117", datatype, false), + array, + ) + }) + }) + .transpose()? + }, + { + self.fuzz2118 + .as_ref() + .map(|many| { + let array = + ::try_to_arrow(many.iter(), None); + array.map(|array| { + let datatype = ::arrow2::datatypes::DataType::Extension( + "rerun.testing.components.AffixFuzzer18".into(), + Box::new(array.data_type().clone()), + Some("rerun.testing.components.AffixFuzzer18".into()), + ); + ( + ::arrow2::datatypes::Field::new("fuzz2118", datatype, false), + array, + ) + }) + }) + .transpose()? + }, ] .into_iter() .flatten() @@ -1395,6 +1755,62 @@ impl crate::Archetype for AffixFuzzer1 { datatype: ::arrow2::datatypes::DataType::Null, })? }; + let fuzz1014 = { + let array = arrays_by_name.get("fuzz1014").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 fuzz1016 = { + let array = arrays_by_name.get("fuzz1016").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 fuzz1017 = { + let array = arrays_by_name.get("fuzz1017").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 fuzz1018 = { + let array = arrays_by_name.get("fuzz1018").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 { @@ -1590,6 +2006,66 @@ impl crate::Archetype for AffixFuzzer1 { }) .collect::>>()? }; + let fuzz1114 = { + let array = arrays_by_name.get("fuzz1114").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 fuzz1116 = { + let array = arrays_by_name.get("fuzz1116").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 fuzz1117 = { + let array = arrays_by_name.get("fuzz1117").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 fuzz1118 = { + let array = arrays_by_name.get("fuzz1118").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 = if let Some(array) = arrays_by_name.get("fuzz2001") { Some( ::try_from_arrow_opt(&**array)? @@ -1759,6 +2235,58 @@ impl crate::Archetype for AffixFuzzer1 { } else { None }; + let fuzz2014 = if let Some(array) = arrays_by_name.get("fuzz2014") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2016 = if let Some(array) = arrays_by_name.get("fuzz2016") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2017 = if let Some(array) = arrays_by_name.get("fuzz2017") { + Some( + ::try_from_arrow_opt(&**array)? + .into_iter() + .next() + .flatten() + .ok_or_else(|| crate::DeserializationError::MissingData { + datatype: ::arrow2::datatypes::DataType::Null, + })?, + ) + } else { + None + }; + let fuzz2018 = if let Some(array) = arrays_by_name.get("fuzz2018") { + 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)? @@ -1941,6 +2469,62 @@ impl crate::Archetype for AffixFuzzer1 { } else { None }; + let fuzz2114 = if let Some(array) = arrays_by_name.get("fuzz2114") { + 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 fuzz2116 = if let Some(array) = arrays_by_name.get("fuzz2116") { + 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 fuzz2117 = if let Some(array) = arrays_by_name.get("fuzz2117") { + 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 fuzz2118 = if let Some(array) = arrays_by_name.get("fuzz2118") { + 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, @@ -1955,6 +2539,10 @@ impl crate::Archetype for AffixFuzzer1 { fuzz1011, fuzz1012, fuzz1013, + fuzz1014, + fuzz1016, + fuzz1017, + fuzz1018, fuzz1101, fuzz1102, fuzz1103, @@ -1968,6 +2556,10 @@ impl crate::Archetype for AffixFuzzer1 { fuzz1111, fuzz1112, fuzz1113, + fuzz1114, + fuzz1116, + fuzz1117, + fuzz1118, fuzz2001, fuzz2002, fuzz2003, @@ -1981,6 +2573,10 @@ impl crate::Archetype for AffixFuzzer1 { fuzz2011, fuzz2012, fuzz2013, + fuzz2014, + fuzz2016, + fuzz2017, + fuzz2018, fuzz2101, fuzz2102, fuzz2103, @@ -1994,6 +2590,10 @@ impl crate::Archetype for AffixFuzzer1 { fuzz2111, fuzz2112, fuzz2113, + fuzz2114, + fuzz2116, + fuzz2117, + fuzz2118, }) } } @@ -2013,6 +2613,10 @@ impl AffixFuzzer1 { fuzz1011: impl Into, fuzz1012: impl Into, fuzz1013: impl Into, + fuzz1014: impl Into, + fuzz1016: impl Into, + fuzz1017: impl Into, + fuzz1018: impl Into, fuzz1101: impl IntoIterator>, fuzz1102: impl IntoIterator>, fuzz1103: impl IntoIterator>, @@ -2026,6 +2630,10 @@ impl AffixFuzzer1 { fuzz1111: impl IntoIterator>, fuzz1112: impl IntoIterator>, fuzz1113: impl IntoIterator>, + fuzz1114: impl IntoIterator>, + fuzz1116: impl IntoIterator>, + fuzz1117: impl IntoIterator>, + fuzz1118: impl IntoIterator>, ) -> Self { Self { fuzz1001: fuzz1001.into(), @@ -2041,6 +2649,10 @@ impl AffixFuzzer1 { fuzz1011: fuzz1011.into(), fuzz1012: fuzz1012.into(), fuzz1013: fuzz1013.into(), + fuzz1014: fuzz1014.into(), + fuzz1016: fuzz1016.into(), + fuzz1017: fuzz1017.into(), + fuzz1018: fuzz1018.into(), fuzz1101: fuzz1101.into_iter().map(Into::into).collect(), fuzz1102: fuzz1102.into_iter().map(Into::into).collect(), fuzz1103: fuzz1103.into_iter().map(Into::into).collect(), @@ -2054,6 +2666,10 @@ 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(), + fuzz1114: fuzz1114.into_iter().map(Into::into).collect(), + fuzz1116: fuzz1116.into_iter().map(Into::into).collect(), + fuzz1117: fuzz1117.into_iter().map(Into::into).collect(), + fuzz1118: fuzz1118.into_iter().map(Into::into).collect(), fuzz2001: None, fuzz2002: None, fuzz2003: None, @@ -2067,6 +2683,10 @@ impl AffixFuzzer1 { fuzz2011: None, fuzz2012: None, fuzz2013: None, + fuzz2014: None, + fuzz2016: None, + fuzz2017: None, + fuzz2018: None, fuzz2101: None, fuzz2102: None, fuzz2103: None, @@ -2080,6 +2700,10 @@ impl AffixFuzzer1 { fuzz2111: None, fuzz2112: None, fuzz2113: None, + fuzz2114: None, + fuzz2116: None, + fuzz2117: None, + fuzz2118: None, } } @@ -2148,6 +2772,26 @@ impl AffixFuzzer1 { self } + pub fn with_fuzz2014(mut self, fuzz2014: impl Into) -> Self { + self.fuzz2014 = Some(fuzz2014.into()); + self + } + + pub fn with_fuzz2016(mut self, fuzz2016: impl Into) -> Self { + self.fuzz2016 = Some(fuzz2016.into()); + self + } + + pub fn with_fuzz2017(mut self, fuzz2017: impl Into) -> Self { + self.fuzz2017 = Some(fuzz2017.into()); + self + } + + pub fn with_fuzz2018(mut self, fuzz2018: impl Into) -> Self { + self.fuzz2018 = Some(fuzz2018.into()); + self + } + pub fn with_fuzz2101( mut self, fuzz2101: impl IntoIterator>, @@ -2251,4 +2895,36 @@ impl AffixFuzzer1 { self.fuzz2113 = Some(fuzz2113.into_iter().map(Into::into).collect()); self } + + pub fn with_fuzz2114( + mut self, + fuzz2114: impl IntoIterator>, + ) -> Self { + self.fuzz2114 = Some(fuzz2114.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2116( + mut self, + fuzz2116: impl IntoIterator>, + ) -> Self { + self.fuzz2116 = Some(fuzz2116.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2117( + mut self, + fuzz2117: impl IntoIterator>, + ) -> Self { + self.fuzz2117 = Some(fuzz2117.into_iter().map(Into::into).collect()); + self + } + + pub fn with_fuzz2118( + mut self, + fuzz2118: impl IntoIterator>, + ) -> Self { + self.fuzz2118 = Some(fuzz2118.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 92d070bd0bd5..86dce356d09d 100644 --- a/crates/re_types/src/components/fuzzy.rs +++ b/crates/re_types/src/components/fuzzy.rs @@ -2333,3 +2333,2133 @@ impl crate::Component for AffixFuzzer13 { .collect::>>>()?) } } + +#[derive(Debug, Clone, PartialEq)] +pub struct AffixFuzzer14 { + pub single_required_union: crate::datatypes::AffixFuzzer3, +} + +impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer14> { + #[inline] + fn from(value: AffixFuzzer14) -> Self { + std::borrow::Cow::Owned(value) + } +} + +impl<'a> From<&'a AffixFuzzer14> for ::std::borrow::Cow<'a, AffixFuzzer14> { + #[inline] + fn from(value: &'a AffixFuzzer14) -> Self { + std::borrow::Cow::Borrowed(value) + } +} + +impl crate::Component for AffixFuzzer14 { + #[inline] + fn name() -> crate::ComponentName { + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer14") + } + + #[allow(unused_imports, clippy::wildcard_imports)] + #[inline] + fn to_arrow_datatype() -> arrow2::datatypes::DataType { + use ::arrow2::datatypes::*; + DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_to_arrow_opt<'a>( + data: impl IntoIterator>>>, + extension_wrapper: Option<&str>, + ) -> crate::SerializationResult> + where + Self: Clone + 'a, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let (somes, single_required_union): (Vec<_>, Vec<_>) = data + .into_iter() + .map(|datum| { + let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); + let datum = datum.map(|datum| { + let Self { + single_required_union, + } = datum.into_owned(); + single_required_union + }); + (datum.is_some(), datum) + }) + .unzip(); + let single_required_union_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + { + _ = single_required_union_bitmap; + _ = extension_wrapper; + crate::datatypes::AffixFuzzer3::try_to_arrow_opt( + single_required_union, + Some("rerun.testing.components.AffixFuzzer14"), + )? + } + }) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_from_arrow_opt( + data: &dyn ::arrow2::array::Array, + ) -> crate::DeserializationResult>> + where + Self: Sized, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok(crate::datatypes::AffixFuzzer3::try_from_arrow_opt(data)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) + .map(|res| { + res.map(|single_required_union| { + Some(Self { + single_required_union, + }) + }) + }) + .collect::>>>()?) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct AffixFuzzer16 { + pub many_required_unions: Vec, +} + +impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer16> { + #[inline] + fn from(value: AffixFuzzer16) -> Self { + std::borrow::Cow::Owned(value) + } +} + +impl<'a> From<&'a AffixFuzzer16> for ::std::borrow::Cow<'a, AffixFuzzer16> { + #[inline] + fn from(value: &'a AffixFuzzer16) -> Self { + std::borrow::Cow::Borrowed(value) + } +} + +impl crate::Component for AffixFuzzer16 { + #[inline] + fn name() -> crate::ComponentName { + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer16") + } + + #[allow(unused_imports, clippy::wildcard_imports)] + #[inline] + fn to_arrow_datatype() -> arrow2::datatypes::DataType { + use ::arrow2::datatypes::*; + DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + })) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_to_arrow_opt<'a>( + data: impl IntoIterator>>>, + extension_wrapper: Option<&str>, + ) -> crate::SerializationResult> + where + Self: Clone + 'a, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let (somes, many_required_unions): (Vec<_>, Vec<_>) = data + .into_iter() + .map(|datum| { + let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); + let datum = datum.map(|datum| { + let Self { + many_required_unions, + } = datum.into_owned(); + many_required_unions + }); + (datum.is_some(), datum) + }) + .unzip(); + let many_required_unions_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + { + use arrow2::{buffer::Buffer, offset::OffsetsBuffer}; + let many_required_unions_inner_data: Vec<_> = many_required_unions + .iter() + .flatten() + .flatten() + .map(ToOwned::to_owned) + .map(Some) + .collect(); + let many_required_unions_inner_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = many_required_unions_inner_data.iter().any(|v| v.is_none()); + any_nones.then(|| { + many_required_unions_inner_data + .iter() + .map(|v| v.is_some()) + .collect() + }) + }; + let offsets = ::arrow2::offset::Offsets::::try_from_lengths( + many_required_unions + .iter() + .map(|opt| opt.as_ref().map(|datum| datum.len()).unwrap_or_default()), + ) + .unwrap() + .into(); + ListArray::new( + { + _ = extension_wrapper; + DataType::Extension( + "rerun.testing.components.AffixFuzzer16".to_owned(), + Box::new(DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + )), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + }))), + None, + ) + .to_logical_type() + .clone() + }, + offsets, + { + _ = many_required_unions_inner_bitmap; + _ = extension_wrapper; + crate::datatypes::AffixFuzzer3::try_to_arrow_opt( + many_required_unions_inner_data, + Some("rerun.testing.components.AffixFuzzer16"), + )? + }, + many_required_unions_bitmap, + ) + .boxed() + } + }) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_from_arrow_opt( + data: &dyn ::arrow2::array::Array, + ) -> crate::DeserializationResult>> + where + Self: Sized, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let datatype = data.data_type(); + let data = data + .as_any() + .downcast_ref::<::arrow2::array::ListArray>() + .unwrap(); + let bitmap = data.validity().cloned(); + let offsets = { + let offsets = data.offsets(); + offsets.iter().copied().zip(offsets.iter().copied().skip(1)) + }; + let data = &**data.values(); + let data = crate::datatypes::AffixFuzzer3::try_from_arrow_opt(data)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + }) + }) + .collect::>>()?; + offsets + .enumerate() + .map(move |(i, (start, end))| { + bitmap + .as_ref() + .map_or(true, |bitmap| bitmap.get_bit(i)) + .then(|| { + Ok(data + .get(start as usize..end as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (start as usize, end as usize), + len: data.len(), + datatype: datatype.clone(), + })? + .to_vec()) + }) + .transpose() + }) + .collect::>>>()? + .into_iter() + } + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: data.data_type().clone(), + }) + }) + .map(|res| { + res.map(|many_required_unions| { + Some(Self { + many_required_unions, + }) + }) + }) + .collect::>>>()?) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct AffixFuzzer17 { + pub many_optional_unions: Option>, +} + +impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer17> { + #[inline] + fn from(value: AffixFuzzer17) -> Self { + std::borrow::Cow::Owned(value) + } +} + +impl<'a> From<&'a AffixFuzzer17> for ::std::borrow::Cow<'a, AffixFuzzer17> { + #[inline] + fn from(value: &'a AffixFuzzer17) -> Self { + std::borrow::Cow::Borrowed(value) + } +} + +impl crate::Component for AffixFuzzer17 { + #[inline] + fn name() -> crate::ComponentName { + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer17") + } + + #[allow(unused_imports, clippy::wildcard_imports)] + #[inline] + fn to_arrow_datatype() -> arrow2::datatypes::DataType { + use ::arrow2::datatypes::*; + DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: true, + metadata: [].into(), + })) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_to_arrow_opt<'a>( + data: impl IntoIterator>>>, + extension_wrapper: Option<&str>, + ) -> crate::SerializationResult> + where + Self: Clone + 'a, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let (somes, many_optional_unions): (Vec<_>, Vec<_>) = data + .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_unions, + } = datum.into_owned(); + many_optional_unions + }) + .flatten(); + (datum.is_some(), datum) + }) + .unzip(); + let many_optional_unions_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + { + use arrow2::{buffer::Buffer, offset::OffsetsBuffer}; + let many_optional_unions_inner_data: Vec<_> = many_optional_unions + .iter() + .flatten() + .flatten() + .map(ToOwned::to_owned) + .map(Some) + .collect(); + let many_optional_unions_inner_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = many_optional_unions_inner_data.iter().any(|v| v.is_none()); + any_nones.then(|| { + many_optional_unions_inner_data + .iter() + .map(|v| v.is_some()) + .collect() + }) + }; + let offsets = ::arrow2::offset::Offsets::::try_from_lengths( + many_optional_unions + .iter() + .map(|opt| opt.as_ref().map(|datum| datum.len()).unwrap_or_default()), + ) + .unwrap() + .into(); + ListArray::new( + { + _ = extension_wrapper; + DataType::Extension( + "rerun.testing.components.AffixFuzzer17".to_owned(), + Box::new(DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + )), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: true, + metadata: [].into(), + }))), + None, + ) + .to_logical_type() + .clone() + }, + offsets, + { + _ = many_optional_unions_inner_bitmap; + _ = extension_wrapper; + crate::datatypes::AffixFuzzer3::try_to_arrow_opt( + many_optional_unions_inner_data, + Some("rerun.testing.components.AffixFuzzer17"), + )? + }, + many_optional_unions_bitmap, + ) + .boxed() + } + }) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_from_arrow_opt( + data: &dyn ::arrow2::array::Array, + ) -> crate::DeserializationResult>> + where + Self: Sized, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let datatype = data.data_type(); + let data = data + .as_any() + .downcast_ref::<::arrow2::array::ListArray>() + .unwrap(); + let bitmap = data.validity().cloned(); + let offsets = { + let offsets = data.offsets(); + offsets.iter().copied().zip(offsets.iter().copied().skip(1)) + }; + let data = &**data.values(); + let data = crate::datatypes::AffixFuzzer3::try_from_arrow_opt(data)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + }) + }) + .collect::>>()?; + offsets + .enumerate() + .map(move |(i, (start, end))| { + bitmap + .as_ref() + .map_or(true, |bitmap| bitmap.get_bit(i)) + .then(|| { + Ok(data + .get(start as usize..end as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (start as usize, end as usize), + len: data.len(), + datatype: datatype.clone(), + })? + .to_vec()) + }) + .transpose() + }) + .collect::>>>()? + .into_iter() + } + .map(Ok) + .map(|res| { + res.map(|many_optional_unions| { + Some(Self { + many_optional_unions, + }) + }) + }) + .collect::>>>()?) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub struct AffixFuzzer18 { + pub many_optional_unions: Option>, +} + +impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer18> { + #[inline] + fn from(value: AffixFuzzer18) -> Self { + std::borrow::Cow::Owned(value) + } +} + +impl<'a> From<&'a AffixFuzzer18> for ::std::borrow::Cow<'a, AffixFuzzer18> { + #[inline] + fn from(value: &'a AffixFuzzer18) -> Self { + std::borrow::Cow::Borrowed(value) + } +} + +impl crate::Component for AffixFuzzer18 { + #[inline] + fn name() -> crate::ComponentName { + crate::ComponentName::Borrowed("rerun.testing.components.AffixFuzzer18") + } + + #[allow(unused_imports, clippy::wildcard_imports)] + #[inline] + fn to_arrow_datatype() -> arrow2::datatypes::DataType { + use ::arrow2::datatypes::*; + DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "single_required".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: true, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: true, + metadata: [].into(), + })) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_to_arrow_opt<'a>( + data: impl IntoIterator>>>, + extension_wrapper: Option<&str>, + ) -> crate::SerializationResult> + where + Self: Clone + 'a, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let (somes, many_optional_unions): (Vec<_>, Vec<_>) = data + .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_unions, + } = datum.into_owned(); + many_optional_unions + }) + .flatten(); + (datum.is_some(), datum) + }) + .unzip(); + let many_optional_unions_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + { + use arrow2::{buffer::Buffer, offset::OffsetsBuffer}; + let many_optional_unions_inner_data: Vec<_> = many_optional_unions + .iter() + .flatten() + .flatten() + .map(ToOwned::to_owned) + .map(Some) + .collect(); + let many_optional_unions_inner_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = many_optional_unions_inner_data.iter().any(|v| v.is_none()); + any_nones.then(|| { + many_optional_unions_inner_data + .iter() + .map(|v| v.is_some()) + .collect() + }) + }; + let offsets = ::arrow2::offset::Offsets::::try_from_lengths( + many_optional_unions + .iter() + .map(|opt| opt.as_ref().map(|datum| datum.len()).unwrap_or_default()), + ) + .unwrap() + .into(); + ListArray :: new ({ _ = extension_wrapper ; DataType :: Extension ("rerun.testing.components.AffixFuzzer18" . to_owned () , Box :: new (DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Union (vec ! [Field { name : "single_required" . to_owned () , data_type : DataType :: Union (vec ! [Field { name : "degrees" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "radians" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "craziness" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Struct (vec ! [Field { name : "single_float_optional" . to_owned () , data_type : DataType :: Float32 , is_nullable : true , metadata : [] . into () , } + + , Field { name : "single_string_required" . to_owned () , data_type : DataType :: Utf8 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "single_string_optional" . to_owned () , data_type : DataType :: Utf8 , is_nullable : true , metadata : [] . into () , } + + , Field { name : "many_floats_optional" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Float32 , is_nullable : true , metadata : [] . into () , } + +)) , is_nullable : true , metadata : [] . into () , } + + , Field { name : "many_strings_required" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Utf8 , is_nullable : false , metadata : [] . into () , } + +)) , is_nullable : false , metadata : [] . into () , } + + , Field { name : "many_strings_optional" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Utf8 , is_nullable : true , metadata : [] . into () , } + +)) , is_nullable : true , metadata : [] . into () , } + + , Field { name : "flattened_scalar" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "almost_flattened_scalar" . to_owned () , data_type : DataType :: Struct (vec ! [Field { name : "value" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + ,]) , is_nullable : false , metadata : [] . into () , } + + ,]) , is_nullable : false , metadata : [] . into () , } + +)) , is_nullable : false , metadata : [] . into () , } + + ,] , None , UnionMode :: Dense) , is_nullable : false , metadata : [] . into () , } + + , Field { name : "many_required" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Union (vec ! [Field { name : "degrees" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "radians" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "craziness" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Struct (vec ! [Field { name : "single_float_optional" . to_owned () , data_type : DataType :: Float32 , is_nullable : true , metadata : [] . into () , } + + , Field { name : "single_string_required" . to_owned () , data_type : DataType :: Utf8 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "single_string_optional" . to_owned () , data_type : DataType :: Utf8 , is_nullable : true , metadata : [] . into () , } + + , Field { name : "many_floats_optional" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Float32 , is_nullable : true , metadata : [] . into () , } + +)) , is_nullable : true , metadata : [] . into () , } + + , Field { name : "many_strings_required" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Utf8 , is_nullable : false , metadata : [] . into () , } + +)) , is_nullable : false , metadata : [] . into () , } + + , Field { name : "many_strings_optional" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Utf8 , is_nullable : true , metadata : [] . into () , } + +)) , is_nullable : true , metadata : [] . into () , } + + , Field { name : "flattened_scalar" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "almost_flattened_scalar" . to_owned () , data_type : DataType :: Struct (vec ! [Field { name : "value" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + ,]) , is_nullable : false , metadata : [] . into () , } + + ,]) , is_nullable : false , metadata : [] . into () , } + +)) , is_nullable : false , metadata : [] . into () , } + + ,] , None , UnionMode :: Dense) , is_nullable : false , metadata : [] . into () , } + +)) , is_nullable : false , metadata : [] . into () , } + + , Field { name : "many_optional" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Union (vec ! [Field { name : "degrees" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "radians" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "craziness" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Struct (vec ! [Field { name : "single_float_optional" . to_owned () , data_type : DataType :: Float32 , is_nullable : true , metadata : [] . into () , } + + , Field { name : "single_string_required" . to_owned () , data_type : DataType :: Utf8 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "single_string_optional" . to_owned () , data_type : DataType :: Utf8 , is_nullable : true , metadata : [] . into () , } + + , Field { name : "many_floats_optional" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Float32 , is_nullable : true , metadata : [] . into () , } + +)) , is_nullable : true , metadata : [] . into () , } + + , Field { name : "many_strings_required" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Utf8 , is_nullable : false , metadata : [] . into () , } + +)) , is_nullable : false , metadata : [] . into () , } + + , Field { name : "many_strings_optional" . to_owned () , data_type : DataType :: List (Box :: new (Field { name : "item" . to_owned () , data_type : DataType :: Utf8 , is_nullable : true , metadata : [] . into () , } + +)) , is_nullable : true , metadata : [] . into () , } + + , Field { name : "flattened_scalar" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + , Field { name : "almost_flattened_scalar" . to_owned () , data_type : DataType :: Struct (vec ! [Field { name : "value" . to_owned () , data_type : DataType :: Float32 , is_nullable : false , metadata : [] . into () , } + + ,]) , is_nullable : false , metadata : [] . into () , } + + ,]) , is_nullable : false , metadata : [] . into () , } + +)) , is_nullable : false , metadata : [] . into () , } + + ,] , None , UnionMode :: Dense) , is_nullable : true , metadata : [] . into () , } + +)) , is_nullable : false , metadata : [] . into () , } + + ,] , None , UnionMode :: Dense) , is_nullable : true , metadata : [] . into () , } + +))) , None) . to_logical_type () . clone () } + + , offsets , { _ = many_optional_unions_inner_bitmap ; _ = extension_wrapper ; crate :: datatypes :: AffixFuzzer4 :: try_to_arrow_opt (many_optional_unions_inner_data , Some ("rerun.testing.components.AffixFuzzer18")) ? } + + , many_optional_unions_bitmap ,) . boxed () + } + }) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_from_arrow_opt( + data: &dyn ::arrow2::array::Array, + ) -> crate::DeserializationResult>> + where + Self: Sized, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let datatype = data.data_type(); + let data = data + .as_any() + .downcast_ref::<::arrow2::array::ListArray>() + .unwrap(); + let bitmap = data.validity().cloned(); + let offsets = { + let offsets = data.offsets(); + offsets.iter().copied().zip(offsets.iter().copied().skip(1)) + }; + let data = &**data.values(); + let data = crate::datatypes::AffixFuzzer4::try_from_arrow_opt(data)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: DataType::Union( + vec![ + Field { + name: "single_required".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional" + .to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required" + .to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + )), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional" + .to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar" + .to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional" + .to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: + DataType::Float32, + is_nullable: true, + metadata: [].into(), + }), + ), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }), + ), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }), + ), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar" + .to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "value".to_owned(), + data_type: + DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional" + .to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: + DataType::Float32, + is_nullable: true, + metadata: [].into(), + }), + ), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }), + ), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }), + ), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar" + .to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "value".to_owned(), + data_type: + DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: true, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + }) + }) + .collect::>>()?; + offsets + .enumerate() + .map(move |(i, (start, end))| { + bitmap + .as_ref() + .map_or(true, |bitmap| bitmap.get_bit(i)) + .then(|| { + Ok(data + .get(start as usize..end as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (start as usize, end as usize), + len: data.len(), + datatype: datatype.clone(), + })? + .to_vec()) + }) + .transpose() + }) + .collect::>>>()? + .into_iter() + } + .map(Ok) + .map(|res| { + res.map(|many_optional_unions| { + Some(Self { + many_optional_unions, + }) + }) + }) + .collect::>>>()?) + } +} diff --git a/crates/re_types/src/components/mod.rs b/crates/re_types/src/components/mod.rs index c78f73fde1c8..2270c64ddc68 100644 --- a/crates/re_types/src/components/mod.rs +++ b/crates/re_types/src/components/mod.rs @@ -22,9 +22,9 @@ pub use self::class_id::ClassId; pub use self::color::Color; pub use self::draw_order::DrawOrder; pub use self::fuzzy::{ - AffixFuzzer1, AffixFuzzer10, AffixFuzzer11, AffixFuzzer12, AffixFuzzer13, AffixFuzzer2, - AffixFuzzer3, AffixFuzzer4, AffixFuzzer5, AffixFuzzer6, AffixFuzzer7, AffixFuzzer8, - AffixFuzzer9, + AffixFuzzer1, AffixFuzzer10, AffixFuzzer11, AffixFuzzer12, AffixFuzzer13, AffixFuzzer14, + AffixFuzzer16, AffixFuzzer17, AffixFuzzer18, AffixFuzzer2, AffixFuzzer3, AffixFuzzer4, + AffixFuzzer5, AffixFuzzer6, AffixFuzzer7, AffixFuzzer8, AffixFuzzer9, }; pub use self::instance_key::InstanceKey; pub use self::keypoint_id::KeypointId; diff --git a/crates/re_types/src/datatypes/fuzzy.rs b/crates/re_types/src/datatypes/fuzzy.rs index 8498243f1c7d..dfbbe5b6c8de 100644 --- a/crates/re_types/src/datatypes/fuzzy.rs +++ b/crates/re_types/src/datatypes/fuzzy.rs @@ -1150,3 +1150,1800 @@ impl crate::Datatype for AffixFuzzer2 { .collect::>>>()?) } } + +#[derive(Debug, Clone, PartialEq)] +pub enum AffixFuzzer3 { + Degrees(f32), + Radians(Option), + Craziness(Vec), +} + +impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer3> { + #[inline] + fn from(value: AffixFuzzer3) -> Self { + std::borrow::Cow::Owned(value) + } +} + +impl<'a> From<&'a AffixFuzzer3> for ::std::borrow::Cow<'a, AffixFuzzer3> { + #[inline] + fn from(value: &'a AffixFuzzer3) -> Self { + std::borrow::Cow::Borrowed(value) + } +} + +impl crate::Datatype for AffixFuzzer3 { + #[inline] + fn name() -> crate::DatatypeName { + crate::DatatypeName::Borrowed("rerun.testing.datatypes.AffixFuzzer3") + } + + #[allow(unused_imports, clippy::wildcard_imports)] + #[inline] + fn to_arrow_datatype() -> arrow2::datatypes::DataType { + use ::arrow2::datatypes::*; + DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_to_arrow_opt<'a>( + data: impl IntoIterator>>>, + extension_wrapper: Option<&str>, + ) -> crate::SerializationResult> + where + Self: Clone + 'a, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let data: Vec<_> = data + .into_iter() + .map(|datum| { + let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); + datum + }) + .collect(); + UnionArray::new( + (if let Some(ext) = extension_wrapper { + DataType::Extension( + ext.to_owned(), + Box::new(::to_arrow_datatype()), + None, + ) + } else { + ::to_arrow_datatype() + }) + .to_logical_type() + .clone(), + { + data.iter() + .flatten() + .map(|v| match **v { + AffixFuzzer3::Degrees(_) => 0i8, + AffixFuzzer3::Radians(_) => 1i8, + AffixFuzzer3::Craziness(_) => 2i8, + }) + .collect() + }, + vec![ + { + let (somes, degrees): (Vec<_>, Vec<_>) = data + .iter() + .flatten() + .filter(|datum| matches!(***datum, AffixFuzzer3::Degrees(_))) + .map(|datum| { + let datum = match &**datum { + AffixFuzzer3::Degrees(v) => Some(v.clone()), + _ => None, + }; + (datum.is_some(), datum) + }) + .unzip(); + let degrees_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + PrimitiveArray::new( + { + _ = extension_wrapper; + DataType::Float32.to_logical_type().clone() + }, + degrees.into_iter().map(|v| v.unwrap_or_default()).collect(), + degrees_bitmap, + ) + .boxed() + }, + { + let (somes, radians): (Vec<_>, Vec<_>) = data + .iter() + .flatten() + .filter(|datum| matches!(***datum, AffixFuzzer3::Radians(_))) + .map(|datum| { + let datum = match &**datum { + AffixFuzzer3::Radians(v) => Some(v.clone()), + _ => None, + } + .flatten(); + (datum.is_some(), datum) + }) + .unzip(); + let radians_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + PrimitiveArray::new( + { + _ = extension_wrapper; + DataType::Float32.to_logical_type().clone() + }, + radians.into_iter().map(|v| v.unwrap_or_default()).collect(), + radians_bitmap, + ) + .boxed() + }, + { + let (somes, craziness): (Vec<_>, Vec<_>) = data + .iter() + .flatten() + .filter(|datum| matches!(***datum, AffixFuzzer3::Craziness(_))) + .map(|datum| { + let datum = match &**datum { + AffixFuzzer3::Craziness(v) => Some(v.clone()), + _ => None, + }; + (datum.is_some(), datum) + }) + .unzip(); + let craziness_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + { + use arrow2::{buffer::Buffer, offset::OffsetsBuffer}; + let craziness_inner_data: Vec<_> = craziness + .iter() + .flatten() + .flatten() + .map(ToOwned::to_owned) + .map(Some) + .collect(); + let craziness_inner_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = craziness_inner_data.iter().any(|v| v.is_none()); + any_nones.then(|| { + craziness_inner_data.iter().map(|v| v.is_some()).collect() + }) + }; + let offsets = ::arrow2::offset::Offsets::::try_from_lengths( + craziness.iter().map(|opt| { + opt.as_ref().map(|datum| datum.len()).unwrap_or_default() + }), + ) + .unwrap() + .into(); + ListArray::new( + { + _ = extension_wrapper; + DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })) + .to_logical_type() + .clone() + }, + offsets, + { + _ = craziness_inner_bitmap; + _ = extension_wrapper; + crate::datatypes::AffixFuzzer1::try_to_arrow_opt( + craziness_inner_data, + None::<&str>, + )? + }, + craziness_bitmap, + ) + .boxed() + } + }, + ], + Some({ + let mut degrees_offset = 0; + let mut radians_offset = 0; + let mut craziness_offset = 0; + data.iter() + .flatten() + .map(|v| match **v { + AffixFuzzer3::Degrees(_) => { + let offset = degrees_offset; + degrees_offset += 1; + offset + } + + AffixFuzzer3::Radians(_) => { + let offset = radians_offset; + radians_offset += 1; + offset + } + + AffixFuzzer3::Craziness(_) => { + let offset = craziness_offset; + craziness_offset += 1; + offset + } + }) + .collect() + }), + ) + .boxed() + }) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_from_arrow_opt( + data: &dyn ::arrow2::array::Array, + ) -> crate::DeserializationResult>> + where + Self: Sized, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let data = data + .as_any() + .downcast_ref::<::arrow2::array::UnionArray>() + .ok_or_else(|| crate::DeserializationError::SchemaMismatch { + expected: data.data_type().clone(), + got: data.data_type().clone(), + })?; + let (data_types, data_arrays, data_offsets) = + (data.types(), data.fields(), data.offsets().unwrap()); + let degrees = { + let data = &*data_arrays[0usize]; + + data.as_any() + .downcast_ref::() + .unwrap() + .into_iter() + .map(|v| v.copied()) + .collect::>() + }; + let radians = { + let data = &*data_arrays[1usize]; + + data.as_any() + .downcast_ref::() + .unwrap() + .into_iter() + .map(|v| v.copied()) + .collect::>() + }; + let craziness = { + let data = &*data_arrays[2usize]; + + { + let datatype = data.data_type(); + let data = data + .as_any() + .downcast_ref::<::arrow2::array::ListArray>() + .unwrap(); + let bitmap = data.validity().cloned(); + let offsets = { + let offsets = data.offsets(); + offsets.iter().copied().zip(offsets.iter().copied().skip(1)) + }; + let data = &**data.values(); + let data = crate::datatypes::AffixFuzzer1::try_from_arrow_opt(data)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + }) + }) + .collect::>>()?; + offsets + .enumerate() + .map(move |(i, (start, end))| { + bitmap + .as_ref() + .map_or(true, |bitmap| bitmap.get_bit(i)) + .then(|| { + Ok(data + .get(start as usize..end as usize) + .ok_or_else(|| { + crate::DeserializationError::OffsetsMismatch { + bounds: (start as usize, end as usize), + len: data.len(), + datatype: datatype.clone(), + } + })? + .to_vec()) + }) + .transpose() + }) + .collect::>>>()? + .into_iter() + } + .collect::>() + }; + data_types + .iter() + .enumerate() + .map(|(i, typ)| { + let offset = data_offsets[i]; + + Ok(Some(match typ { + 0i8 => AffixFuzzer3::Degrees( + degrees + .get(offset as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (offset as usize, offset as usize), + len: degrees.len(), + datatype: data.data_type().clone(), + })? + .clone() + .unwrap(), + ), + 1i8 => AffixFuzzer3::Radians( + radians + .get(offset as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (offset as usize, offset as usize), + len: radians.len(), + datatype: data.data_type().clone(), + })? + .clone(), + ), + 2i8 => AffixFuzzer3::Craziness( + craziness + .get(offset as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (offset as usize, offset as usize), + len: craziness.len(), + datatype: data.data_type().clone(), + })? + .clone() + .unwrap(), + ), + _ => unreachable!(), + })) + }) + .collect::>>()? + }) + } +} + +#[derive(Debug, Clone, PartialEq)] +pub enum AffixFuzzer4 { + SingleRequired(crate::datatypes::AffixFuzzer3), + ManyRequired(Vec), + ManyOptional(Option>), +} + +impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer4> { + #[inline] + fn from(value: AffixFuzzer4) -> Self { + std::borrow::Cow::Owned(value) + } +} + +impl<'a> From<&'a AffixFuzzer4> for ::std::borrow::Cow<'a, AffixFuzzer4> { + #[inline] + fn from(value: &'a AffixFuzzer4) -> Self { + std::borrow::Cow::Borrowed(value) + } +} + +impl crate::Datatype for AffixFuzzer4 { + #[inline] + fn name() -> crate::DatatypeName { + crate::DatatypeName::Borrowed("rerun.testing.datatypes.AffixFuzzer4") + } + + #[allow(unused_imports, clippy::wildcard_imports)] + #[inline] + fn to_arrow_datatype() -> arrow2::datatypes::DataType { + use ::arrow2::datatypes::*; + DataType::Union( + vec![ + Field { + name: "single_required".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + })), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: true, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_to_arrow_opt<'a>( + data: impl IntoIterator>>>, + extension_wrapper: Option<&str>, + ) -> crate::SerializationResult> + where + Self: Clone + 'a, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let data: Vec<_> = data + .into_iter() + .map(|datum| { + let datum: Option<::std::borrow::Cow<'a, Self>> = datum.map(Into::into); + datum + }) + .collect(); + UnionArray::new( + (if let Some(ext) = extension_wrapper { + DataType::Extension( + ext.to_owned(), + Box::new(::to_arrow_datatype()), + None, + ) + } else { + ::to_arrow_datatype() + }) + .to_logical_type() + .clone(), + { + data.iter() + .flatten() + .map(|v| match **v { + AffixFuzzer4::SingleRequired(_) => 0i8, + AffixFuzzer4::ManyRequired(_) => 1i8, + AffixFuzzer4::ManyOptional(_) => 2i8, + }) + .collect() + }, + vec![ + { + let (somes, single_required): (Vec<_>, Vec<_>) = data + .iter() + .flatten() + .filter(|datum| matches!(***datum, AffixFuzzer4::SingleRequired(_))) + .map(|datum| { + let datum = match &**datum { + AffixFuzzer4::SingleRequired(v) => Some(v.clone()), + _ => None, + }; + (datum.is_some(), datum) + }) + .unzip(); + let single_required_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + { + _ = single_required_bitmap; + _ = extension_wrapper; + crate::datatypes::AffixFuzzer3::try_to_arrow_opt( + single_required, + None::<&str>, + )? + } + }, + { + let (somes, many_required): (Vec<_>, Vec<_>) = data + .iter() + .flatten() + .filter(|datum| matches!(***datum, AffixFuzzer4::ManyRequired(_))) + .map(|datum| { + let datum = match &**datum { + AffixFuzzer4::ManyRequired(v) => Some(v.clone()), + _ => None, + }; + (datum.is_some(), datum) + }) + .unzip(); + let many_required_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + { + use arrow2::{buffer::Buffer, offset::OffsetsBuffer}; + let many_required_inner_data: Vec<_> = many_required + .iter() + .flatten() + .flatten() + .map(ToOwned::to_owned) + .map(Some) + .collect(); + let many_required_inner_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = + many_required_inner_data.iter().any(|v| v.is_none()); + any_nones.then(|| { + many_required_inner_data + .iter() + .map(|v| v.is_some()) + .collect() + }) + }; + let offsets = ::arrow2::offset::Offsets::::try_from_lengths( + many_required.iter().map(|opt| { + opt.as_ref().map(|datum| datum.len()).unwrap_or_default() + }), + ) + .unwrap() + .into(); + ListArray::new( + { + _ = extension_wrapper; + DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional" + .to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: + DataType::Float32, + is_nullable: true, + metadata: [].into(), + }), + ), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }), + ), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }), + ), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar" + .to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "value".to_owned(), + data_type: + DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: false, + metadata: [].into(), + })) + .to_logical_type() + .clone() + }, + offsets, + { + _ = many_required_inner_bitmap; + _ = extension_wrapper; + crate::datatypes::AffixFuzzer3::try_to_arrow_opt( + many_required_inner_data, + None::<&str>, + )? + }, + many_required_bitmap, + ) + .boxed() + } + }, + { + let (somes, many_optional): (Vec<_>, Vec<_>) = data + .iter() + .flatten() + .filter(|datum| matches!(***datum, AffixFuzzer4::ManyOptional(_))) + .map(|datum| { + let datum = match &**datum { + AffixFuzzer4::ManyOptional(v) => Some(v.clone()), + _ => None, + } + .flatten(); + (datum.is_some(), datum) + }) + .unzip(); + let many_optional_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = somes.iter().any(|some| !*some); + any_nones.then(|| somes.into()) + }; + { + use arrow2::{buffer::Buffer, offset::OffsetsBuffer}; + let many_optional_inner_data: Vec<_> = many_optional + .iter() + .flatten() + .flatten() + .map(ToOwned::to_owned) + .map(Some) + .collect(); + let many_optional_inner_bitmap: Option<::arrow2::bitmap::Bitmap> = { + let any_nones = + many_optional_inner_data.iter().any(|v| v.is_none()); + any_nones.then(|| { + many_optional_inner_data + .iter() + .map(|v| v.is_some()) + .collect() + }) + }; + let offsets = ::arrow2::offset::Offsets::::try_from_lengths( + many_optional.iter().map(|opt| { + opt.as_ref().map(|datum| datum.len()).unwrap_or_default() + }), + ) + .unwrap() + .into(); + ListArray::new( + { + _ = extension_wrapper; + DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional" + .to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional" + .to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: + DataType::Float32, + is_nullable: true, + metadata: [].into(), + }), + ), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }), + ), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional" + .to_owned(), + data_type: DataType::List( + Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }), + ), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar" + .to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "value".to_owned(), + data_type: + DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + is_nullable: true, + metadata: [].into(), + })) + .to_logical_type() + .clone() + }, + offsets, + { + _ = many_optional_inner_bitmap; + _ = extension_wrapper; + crate::datatypes::AffixFuzzer3::try_to_arrow_opt( + many_optional_inner_data, + None::<&str>, + )? + }, + many_optional_bitmap, + ) + .boxed() + } + }, + ], + Some({ + let mut single_required_offset = 0; + let mut many_required_offset = 0; + let mut many_optional_offset = 0; + data.iter() + .flatten() + .map(|v| match **v { + AffixFuzzer4::SingleRequired(_) => { + let offset = single_required_offset; + single_required_offset += 1; + offset + } + + AffixFuzzer4::ManyRequired(_) => { + let offset = many_required_offset; + many_required_offset += 1; + offset + } + + AffixFuzzer4::ManyOptional(_) => { + let offset = many_optional_offset; + many_optional_offset += 1; + offset + } + }) + .collect() + }), + ) + .boxed() + }) + } + + #[allow(unused_imports, clippy::wildcard_imports)] + fn try_from_arrow_opt( + data: &dyn ::arrow2::array::Array, + ) -> crate::DeserializationResult>> + where + Self: Sized, + { + use crate::{Component as _, Datatype as _}; + use ::arrow2::{array::*, datatypes::*}; + Ok({ + let data = data + .as_any() + .downcast_ref::<::arrow2::array::UnionArray>() + .ok_or_else(|| crate::DeserializationError::SchemaMismatch { + expected: data.data_type().clone(), + got: data.data_type().clone(), + })?; + let (data_types, data_arrays, data_offsets) = + (data.types(), data.fields(), data.offsets().unwrap()); + let single_required = { + let data = &*data_arrays[0usize]; + + crate::datatypes::AffixFuzzer3::try_from_arrow_opt(data)? + .into_iter() + .collect::>() + }; + let many_required = { + let data = &*data_arrays[1usize]; + + { + let datatype = data.data_type(); + let data = data + .as_any() + .downcast_ref::<::arrow2::array::ListArray>() + .unwrap(); + let bitmap = data.validity().cloned(); + let offsets = { + let offsets = data.offsets(); + offsets.iter().copied().zip(offsets.iter().copied().skip(1)) + }; + let data = &**data.values(); + let data = crate::datatypes::AffixFuzzer3::try_from_arrow_opt(data)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + )), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + }) + }) + .collect::>>()?; + offsets + .enumerate() + .map(move |(i, (start, end))| { + bitmap + .as_ref() + .map_or(true, |bitmap| bitmap.get_bit(i)) + .then(|| { + Ok(data + .get(start as usize..end as usize) + .ok_or_else(|| { + crate::DeserializationError::OffsetsMismatch { + bounds: (start as usize, end as usize), + len: data.len(), + datatype: datatype.clone(), + } + })? + .to_vec()) + }) + .transpose() + }) + .collect::>>>()? + .into_iter() + } + .collect::>() + }; + let many_optional = { + let data = &*data_arrays[2usize]; + + { + let datatype = data.data_type(); + let data = data + .as_any() + .downcast_ref::<::arrow2::array::ListArray>() + .unwrap(); + let bitmap = data.validity().cloned(); + let offsets = { + let offsets = data.offsets(); + offsets.iter().copied().zip(offsets.iter().copied().skip(1)) + }; + let data = &**data.values(); + let data = crate::datatypes::AffixFuzzer3::try_from_arrow_opt(data)? + .into_iter() + .map(|v| { + v.ok_or_else(|| crate::DeserializationError::MissingData { + datatype: DataType::Union( + vec![ + Field { + name: "degrees".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "radians".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "craziness".to_owned(), + data_type: DataType::List(Box::new(Field { + name: "item".to_owned(), + data_type: DataType::Struct(vec![ + Field { + name: "single_float_optional".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "single_string_required".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "single_string_optional".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_floats_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Float32, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "many_strings_required".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: false, + metadata: [].into(), + }, + )), + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "many_strings_optional".to_owned(), + data_type: DataType::List(Box::new( + Field { + name: "item".to_owned(), + data_type: DataType::Utf8, + is_nullable: true, + metadata: [].into(), + }, + )), + is_nullable: true, + metadata: [].into(), + }, + Field { + name: "flattened_scalar".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }, + Field { + name: "almost_flattened_scalar".to_owned(), + data_type: DataType::Struct(vec![Field { + name: "value".to_owned(), + data_type: DataType::Float32, + is_nullable: false, + metadata: [].into(), + }]), + is_nullable: false, + metadata: [].into(), + }, + ]), + is_nullable: false, + metadata: [].into(), + })), + is_nullable: false, + metadata: [].into(), + }, + ], + None, + UnionMode::Dense, + ), + }) + }) + .collect::>>()?; + offsets + .enumerate() + .map(move |(i, (start, end))| { + bitmap + .as_ref() + .map_or(true, |bitmap| bitmap.get_bit(i)) + .then(|| { + Ok(data + .get(start as usize..end as usize) + .ok_or_else(|| { + crate::DeserializationError::OffsetsMismatch { + bounds: (start as usize, end as usize), + len: data.len(), + datatype: datatype.clone(), + } + })? + .to_vec()) + }) + .transpose() + }) + .collect::>>>()? + .into_iter() + } + .collect::>() + }; + data_types + .iter() + .enumerate() + .map(|(i, typ)| { + let offset = data_offsets[i]; + + Ok(Some(match typ { + 0i8 => AffixFuzzer4::SingleRequired( + single_required + .get(offset as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (offset as usize, offset as usize), + len: single_required.len(), + datatype: data.data_type().clone(), + })? + .clone() + .unwrap(), + ), + 1i8 => AffixFuzzer4::ManyRequired( + many_required + .get(offset as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (offset as usize, offset as usize), + len: many_required.len(), + datatype: data.data_type().clone(), + })? + .clone() + .unwrap(), + ), + 2i8 => AffixFuzzer4::ManyOptional( + many_optional + .get(offset as usize) + .ok_or_else(|| crate::DeserializationError::OffsetsMismatch { + bounds: (offset as usize, offset as usize), + len: many_optional.len(), + datatype: data.data_type().clone(), + })? + .clone(), + ), + _ => unreachable!(), + })) + }) + .collect::>>()? + }) + } +} diff --git a/crates/re_types/src/datatypes/mod.rs b/crates/re_types/src/datatypes/mod.rs index 57ee71907bf6..6cd583697d69 100644 --- a/crates/re_types/src/datatypes/mod.rs +++ b/crates/re_types/src/datatypes/mod.rs @@ -6,6 +6,6 @@ mod point2d_ext; mod vec2d; mod vec2d_ext; -pub use self::fuzzy::{AffixFuzzer1, AffixFuzzer2, FlattenedScalar}; +pub use self::fuzzy::{AffixFuzzer1, AffixFuzzer2, AffixFuzzer3, AffixFuzzer4, FlattenedScalar}; pub use self::point2d::Point2D; pub use self::vec2d::Vec2D; diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py index ce6276757eaa..1546e3cbffdf 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/archetypes/fuzzy.py @@ -66,6 +66,22 @@ class AffixFuzzer1(Archetype): metadata={"component": "primary"}, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) + fuzz1014: components.AffixFuzzer14Array = field( + metadata={"component": "primary"}, + converter=components.AffixFuzzer14Array.from_similar, # type: ignore[misc] + ) + fuzz1016: components.AffixFuzzer16Array = field( + metadata={"component": "primary"}, + converter=components.AffixFuzzer16Array.from_similar, # type: ignore[misc] + ) + fuzz1017: components.AffixFuzzer17Array = field( + metadata={"component": "primary"}, + converter=components.AffixFuzzer17Array.from_similar, # type: ignore[misc] + ) + fuzz1018: components.AffixFuzzer18Array = field( + metadata={"component": "primary"}, + converter=components.AffixFuzzer18Array.from_similar, # type: ignore[misc] + ) fuzz1101: components.AffixFuzzer1Array = field( metadata={"component": "primary"}, converter=components.AffixFuzzer1Array.from_similar, # type: ignore[misc] @@ -118,6 +134,22 @@ class AffixFuzzer1(Archetype): metadata={"component": "primary"}, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) + fuzz1114: components.AffixFuzzer14Array = field( + metadata={"component": "primary"}, + converter=components.AffixFuzzer14Array.from_similar, # type: ignore[misc] + ) + fuzz1116: components.AffixFuzzer16Array = field( + metadata={"component": "primary"}, + converter=components.AffixFuzzer16Array.from_similar, # type: ignore[misc] + ) + fuzz1117: components.AffixFuzzer17Array = field( + metadata={"component": "primary"}, + converter=components.AffixFuzzer17Array.from_similar, # type: ignore[misc] + ) + fuzz1118: components.AffixFuzzer18Array = field( + metadata={"component": "primary"}, + converter=components.AffixFuzzer18Array.from_similar, # type: ignore[misc] + ) fuzz2001: components.AffixFuzzer1Array | None = field( metadata={"component": "secondary"}, default=None, @@ -183,6 +215,26 @@ class AffixFuzzer1(Archetype): default=None, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) + fuzz2014: components.AffixFuzzer14Array | None = field( + metadata={"component": "secondary"}, + default=None, + converter=components.AffixFuzzer14Array.from_similar, # type: ignore[misc] + ) + fuzz2016: components.AffixFuzzer16Array | None = field( + metadata={"component": "secondary"}, + default=None, + converter=components.AffixFuzzer16Array.from_similar, # type: ignore[misc] + ) + fuzz2017: components.AffixFuzzer17Array | None = field( + metadata={"component": "secondary"}, + default=None, + converter=components.AffixFuzzer17Array.from_similar, # type: ignore[misc] + ) + fuzz2018: components.AffixFuzzer18Array | None = field( + metadata={"component": "secondary"}, + default=None, + converter=components.AffixFuzzer18Array.from_similar, # type: ignore[misc] + ) fuzz2101: components.AffixFuzzer1Array | None = field( metadata={"component": "secondary"}, default=None, @@ -248,5 +300,25 @@ class AffixFuzzer1(Archetype): default=None, converter=components.AffixFuzzer13Array.from_similar, # type: ignore[misc] ) + fuzz2114: components.AffixFuzzer14Array | None = field( + metadata={"component": "secondary"}, + default=None, + converter=components.AffixFuzzer14Array.from_similar, # type: ignore[misc] + ) + fuzz2116: components.AffixFuzzer16Array | None = field( + metadata={"component": "secondary"}, + default=None, + converter=components.AffixFuzzer16Array.from_similar, # type: ignore[misc] + ) + fuzz2117: components.AffixFuzzer17Array | None = field( + metadata={"component": "secondary"}, + default=None, + converter=components.AffixFuzzer17Array.from_similar, # type: ignore[misc] + ) + fuzz2118: components.AffixFuzzer18Array | None = field( + metadata={"component": "secondary"}, + default=None, + converter=components.AffixFuzzer18Array.from_similar, # type: ignore[misc] + ) __str__ = Archetype.__str__ __repr__ = Archetype.__repr__ diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/components/__init__.py b/rerun_py/rerun_sdk/rerun/_rerun2/components/__init__.py index 2f3c5b4701d4..e3fb8b3e5be7 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/components/__init__.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/components/__init__.py @@ -53,6 +53,23 @@ AffixFuzzer13ArrayLike, AffixFuzzer13Like, AffixFuzzer13Type, + AffixFuzzer14Array, + AffixFuzzer14Type, + AffixFuzzer16, + AffixFuzzer16Array, + AffixFuzzer16ArrayLike, + AffixFuzzer16Like, + AffixFuzzer16Type, + AffixFuzzer17, + AffixFuzzer17Array, + AffixFuzzer17ArrayLike, + AffixFuzzer17Like, + AffixFuzzer17Type, + AffixFuzzer18, + AffixFuzzer18Array, + AffixFuzzer18ArrayLike, + AffixFuzzer18Like, + AffixFuzzer18Type, ) from .instance_key import InstanceKey, InstanceKeyArray, InstanceKeyArrayLike, InstanceKeyLike, InstanceKeyType from .keypoint_id import KeypointId, KeypointIdArray, KeypointIdArrayLike, KeypointIdLike, KeypointIdType @@ -81,6 +98,23 @@ "AffixFuzzer13ArrayLike", "AffixFuzzer13Like", "AffixFuzzer13Type", + "AffixFuzzer14Array", + "AffixFuzzer14Type", + "AffixFuzzer16", + "AffixFuzzer16Array", + "AffixFuzzer16ArrayLike", + "AffixFuzzer16Like", + "AffixFuzzer16Type", + "AffixFuzzer17", + "AffixFuzzer17Array", + "AffixFuzzer17ArrayLike", + "AffixFuzzer17Like", + "AffixFuzzer17Type", + "AffixFuzzer18", + "AffixFuzzer18Array", + "AffixFuzzer18ArrayLike", + "AffixFuzzer18Like", + "AffixFuzzer18Type", "AffixFuzzer1Array", "AffixFuzzer1Type", "AffixFuzzer2Array", diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py index 734bce377269..738cd66f05c1 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/components/fuzzy.py @@ -41,6 +41,23 @@ "AffixFuzzer13ArrayLike", "AffixFuzzer13Like", "AffixFuzzer13Type", + "AffixFuzzer14Array", + "AffixFuzzer14Type", + "AffixFuzzer16", + "AffixFuzzer16Array", + "AffixFuzzer16ArrayLike", + "AffixFuzzer16Like", + "AffixFuzzer16Type", + "AffixFuzzer17", + "AffixFuzzer17Array", + "AffixFuzzer17ArrayLike", + "AffixFuzzer17Like", + "AffixFuzzer17Type", + "AffixFuzzer18", + "AffixFuzzer18Array", + "AffixFuzzer18ArrayLike", + "AffixFuzzer18Like", + "AffixFuzzer18Type", "AffixFuzzer1Array", "AffixFuzzer1Type", "AffixFuzzer2Array", @@ -464,3 +481,466 @@ def _native_to_pa_array(data: AffixFuzzer13ArrayLike, data_type: pa.DataType) -> # TODO(cmc): bring back registration to pyarrow once legacy types are gone # pa.register_extension_type(AffixFuzzer13Type()) + + +class AffixFuzzer14Type(BaseDelegatingExtensionType): + _TYPE_NAME = "rerun.testing.components.AffixFuzzer14" + _DELEGATED_EXTENSION_TYPE = datatypes.AffixFuzzer3Type + + +class AffixFuzzer14Array(BaseDelegatingExtensionArray[datatypes.AffixFuzzer3ArrayLike]): + _EXTENSION_NAME = "rerun.testing.components.AffixFuzzer14" + _EXTENSION_TYPE = AffixFuzzer14Type + _DELEGATED_ARRAY_TYPE = datatypes.AffixFuzzer3Array + + +AffixFuzzer14Type._ARRAY_TYPE = AffixFuzzer14Array + +# TODO(cmc): bring back registration to pyarrow once legacy types are gone +# pa.register_extension_type(AffixFuzzer14Type()) + + +@define +class AffixFuzzer16: + many_required_unions: list[datatypes.AffixFuzzer3] = field() + + +AffixFuzzer16Like = AffixFuzzer16 +AffixFuzzer16ArrayLike = Union[ + AffixFuzzer16, + Sequence[AffixFuzzer16Like], +] + + +# --- Arrow support --- + + +class AffixFuzzer16Type(BaseExtensionType): + def __init__(self) -> None: + pa.ExtensionType.__init__( + self, + pa.list_( + pa.field( + "item", + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field("single_float_optional", pa.float32(), True, {}), + 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( + "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("flattened_scalar", pa.float32(), False, {}), + pa.field( + "almost_flattened_scalar", + pa.struct([pa.field("value", pa.float32(), False, {})]), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + "rerun.testing.components.AffixFuzzer16", + ) + + +class AffixFuzzer16Array(BaseExtensionArray[AffixFuzzer16ArrayLike]): + _EXTENSION_NAME = "rerun.testing.components.AffixFuzzer16" + _EXTENSION_TYPE = AffixFuzzer16Type + + @staticmethod + def _native_to_pa_array(data: AffixFuzzer16ArrayLike, data_type: pa.DataType) -> pa.Array: + raise NotImplementedError + + +AffixFuzzer16Type._ARRAY_TYPE = AffixFuzzer16Array + +# TODO(cmc): bring back registration to pyarrow once legacy types are gone +# pa.register_extension_type(AffixFuzzer16Type()) + + +@define +class AffixFuzzer17: + many_optional_unions: list[datatypes.AffixFuzzer3] | None = field(default=None) + + +AffixFuzzer17Like = AffixFuzzer17 +AffixFuzzer17ArrayLike = Union[ + AffixFuzzer17, + Sequence[AffixFuzzer17Like], +] + + +# --- Arrow support --- + + +class AffixFuzzer17Type(BaseExtensionType): + def __init__(self) -> None: + pa.ExtensionType.__init__( + self, + pa.list_( + pa.field( + "item", + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field("single_float_optional", pa.float32(), True, {}), + 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( + "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("flattened_scalar", pa.float32(), False, {}), + pa.field( + "almost_flattened_scalar", + pa.struct([pa.field("value", pa.float32(), False, {})]), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + True, + {}, + ) + ), + "rerun.testing.components.AffixFuzzer17", + ) + + +class AffixFuzzer17Array(BaseExtensionArray[AffixFuzzer17ArrayLike]): + _EXTENSION_NAME = "rerun.testing.components.AffixFuzzer17" + _EXTENSION_TYPE = AffixFuzzer17Type + + @staticmethod + def _native_to_pa_array(data: AffixFuzzer17ArrayLike, data_type: pa.DataType) -> pa.Array: + raise NotImplementedError + + +AffixFuzzer17Type._ARRAY_TYPE = AffixFuzzer17Array + +# TODO(cmc): bring back registration to pyarrow once legacy types are gone +# pa.register_extension_type(AffixFuzzer17Type()) + + +@define +class AffixFuzzer18: + many_optional_unions: list[datatypes.AffixFuzzer4] | None = field(default=None) + + +AffixFuzzer18Like = AffixFuzzer18 +AffixFuzzer18ArrayLike = Union[ + AffixFuzzer18, + Sequence[AffixFuzzer18Like], +] + + +# --- Arrow support --- + + +class AffixFuzzer18Type(BaseExtensionType): + def __init__(self) -> None: + pa.ExtensionType.__init__( + self, + pa.list_( + pa.field( + "item", + pa.dense_union( + [ + pa.field( + "single_required", + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field("single_float_optional", pa.float32(), True, {}), + 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( + "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("flattened_scalar", pa.float32(), False, {}), + pa.field( + "almost_flattened_scalar", + pa.struct([pa.field("value", pa.float32(), False, {})]), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + False, + {}, + ), + pa.field( + "many_required", + pa.list_( + pa.field( + "item", + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field( + "single_float_optional", pa.float32(), True, {} + ), + 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( + "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( + "flattened_scalar", pa.float32(), False, {} + ), + pa.field( + "almost_flattened_scalar", + pa.struct( + [pa.field("value", pa.float32(), False, {})] + ), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + pa.field( + "many_optional", + pa.list_( + pa.field( + "item", + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field( + "single_float_optional", pa.float32(), True, {} + ), + 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( + "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( + "flattened_scalar", pa.float32(), False, {} + ), + pa.field( + "almost_flattened_scalar", + pa.struct( + [pa.field("value", pa.float32(), False, {})] + ), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + True, + {}, + ) + ), + False, + {}, + ), + ] + ), + True, + {}, + ) + ), + "rerun.testing.components.AffixFuzzer18", + ) + + +class AffixFuzzer18Array(BaseExtensionArray[AffixFuzzer18ArrayLike]): + _EXTENSION_NAME = "rerun.testing.components.AffixFuzzer18" + _EXTENSION_TYPE = AffixFuzzer18Type + + @staticmethod + def _native_to_pa_array(data: AffixFuzzer18ArrayLike, data_type: pa.DataType) -> pa.Array: + raise NotImplementedError + + +AffixFuzzer18Type._ARRAY_TYPE = AffixFuzzer18Array + +# TODO(cmc): bring back registration to pyarrow once legacy types are gone +# pa.register_extension_type(AffixFuzzer18Type()) diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/__init__.py b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/__init__.py index 6881e833958a..a841548e06bd 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/__init__.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/__init__.py @@ -13,6 +13,16 @@ AffixFuzzer2ArrayLike, AffixFuzzer2Like, AffixFuzzer2Type, + AffixFuzzer3, + AffixFuzzer3Array, + AffixFuzzer3ArrayLike, + AffixFuzzer3Like, + AffixFuzzer3Type, + AffixFuzzer4, + AffixFuzzer4Array, + AffixFuzzer4ArrayLike, + AffixFuzzer4Like, + AffixFuzzer4Type, FlattenedScalar, FlattenedScalarArray, FlattenedScalarArrayLike, @@ -33,6 +43,16 @@ "AffixFuzzer2ArrayLike", "AffixFuzzer2Like", "AffixFuzzer2Type", + "AffixFuzzer3", + "AffixFuzzer3Array", + "AffixFuzzer3ArrayLike", + "AffixFuzzer3Like", + "AffixFuzzer3Type", + "AffixFuzzer4", + "AffixFuzzer4Array", + "AffixFuzzer4ArrayLike", + "AffixFuzzer4Like", + "AffixFuzzer4Type", "FlattenedScalar", "FlattenedScalarArray", "FlattenedScalarArrayLike", diff --git a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py index 6a69a09ed79a..9428ae131a66 100644 --- a/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py +++ b/rerun_py/rerun_sdk/rerun/_rerun2/datatypes/fuzzy.py @@ -29,6 +29,16 @@ "AffixFuzzer2ArrayLike", "AffixFuzzer2Like", "AffixFuzzer2Type", + "AffixFuzzer3", + "AffixFuzzer3Array", + "AffixFuzzer3ArrayLike", + "AffixFuzzer3Like", + "AffixFuzzer3Type", + "AffixFuzzer4", + "AffixFuzzer4Array", + "AffixFuzzer4ArrayLike", + "AffixFuzzer4Like", + "AffixFuzzer4Type", "FlattenedScalar", "FlattenedScalarArray", "FlattenedScalarArrayLike", @@ -175,3 +185,316 @@ def _native_to_pa_array(data: AffixFuzzer2ArrayLike, data_type: pa.DataType) -> # TODO(cmc): bring back registration to pyarrow once legacy types are gone # pa.register_extension_type(AffixFuzzer2Type()) + + +@define +class AffixFuzzer4: + single_required: datatypes.AffixFuzzer3 | None = None + many_required: list[datatypes.AffixFuzzer3] | None = None + many_optional: list[datatypes.AffixFuzzer3] | None = None + + +AffixFuzzer4Like = AffixFuzzer4 +AffixFuzzer4ArrayLike = Union[ + AffixFuzzer4, + Sequence[AffixFuzzer4Like], +] + + +# --- Arrow support --- + + +class AffixFuzzer4Type(BaseExtensionType): + def __init__(self) -> None: + pa.ExtensionType.__init__( + self, + pa.dense_union( + [ + pa.field( + "single_required", + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field("single_float_optional", pa.float32(), True, {}), + 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( + "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("flattened_scalar", pa.float32(), False, {}), + pa.field( + "almost_flattened_scalar", + pa.struct([pa.field("value", pa.float32(), False, {})]), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + False, + {}, + ), + pa.field( + "many_required", + pa.list_( + pa.field( + "item", + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field("single_float_optional", pa.float32(), True, {}), + 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( + "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("flattened_scalar", pa.float32(), False, {}), + pa.field( + "almost_flattened_scalar", + pa.struct([pa.field("value", pa.float32(), False, {})]), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + pa.field( + "many_optional", + pa.list_( + pa.field( + "item", + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field("single_float_optional", pa.float32(), True, {}), + 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( + "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("flattened_scalar", pa.float32(), False, {}), + pa.field( + "almost_flattened_scalar", + pa.struct([pa.field("value", pa.float32(), False, {})]), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + True, + {}, + ) + ), + False, + {}, + ), + ] + ), + "rerun.testing.datatypes.AffixFuzzer4", + ) + + +class AffixFuzzer4Array(BaseExtensionArray[AffixFuzzer4ArrayLike]): + _EXTENSION_NAME = "rerun.testing.datatypes.AffixFuzzer4" + _EXTENSION_TYPE = AffixFuzzer4Type + + @staticmethod + def _native_to_pa_array(data: AffixFuzzer4ArrayLike, data_type: pa.DataType) -> pa.Array: + raise NotImplementedError + + +AffixFuzzer4Type._ARRAY_TYPE = AffixFuzzer4Array + +# TODO(cmc): bring back registration to pyarrow once legacy types are gone +# pa.register_extension_type(AffixFuzzer4Type()) + + +@define +class AffixFuzzer3: + degrees: float | None = None + radians: float | None = None + craziness: list[datatypes.AffixFuzzer1] | None = None + + +AffixFuzzer3Like = AffixFuzzer3 +AffixFuzzer3ArrayLike = Union[ + AffixFuzzer3, + Sequence[AffixFuzzer3Like], +] + + +# --- Arrow support --- + + +class AffixFuzzer3Type(BaseExtensionType): + def __init__(self) -> None: + pa.ExtensionType.__init__( + self, + pa.dense_union( + [ + pa.field("degrees", pa.float32(), False, {}), + pa.field("radians", pa.float32(), False, {}), + pa.field( + "craziness", + pa.list_( + pa.field( + "item", + pa.struct( + [ + pa.field("single_float_optional", pa.float32(), True, {}), + 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( + "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("flattened_scalar", pa.float32(), False, {}), + pa.field( + "almost_flattened_scalar", + pa.struct([pa.field("value", pa.float32(), False, {})]), + False, + {}, + ), + ] + ), + False, + {}, + ) + ), + False, + {}, + ), + ] + ), + "rerun.testing.datatypes.AffixFuzzer3", + ) + + +class AffixFuzzer3Array(BaseExtensionArray[AffixFuzzer3ArrayLike]): + _EXTENSION_NAME = "rerun.testing.datatypes.AffixFuzzer3" + _EXTENSION_TYPE = AffixFuzzer3Type + + @staticmethod + def _native_to_pa_array(data: AffixFuzzer3ArrayLike, data_type: pa.DataType) -> pa.Array: + raise NotImplementedError + + +AffixFuzzer3Type._ARRAY_TYPE = AffixFuzzer3Array + +# TODO(cmc): bring back registration to pyarrow once legacy types are gone +# pa.register_extension_type(AffixFuzzer3Type()) From ae1df3a205699d298b23df2589441d2b149b1099 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 15:22:58 +0200 Subject: [PATCH 12/13] fuzzy biggie biggie cant you see your size just hypnotize me --- scripts/ci/check_large_files_allow_list.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci/check_large_files_allow_list.txt b/scripts/ci/check_large_files_allow_list.txt index 5a7f3fe8db28..7fb9c28549de 100644 --- a/scripts/ci/check_large_files_allow_list.txt +++ b/scripts/ci/check_large_files_allow_list.txt @@ -1,4 +1,6 @@ Cargo.lock +crates/re_types/src/archetypes/fuzzy.rs crates/re_types/src/components/fuzzy.rs +crates/re_types/src/datatypes/fuzzy.rs crates/re_types_builder/src/reflection.rs crates/re_ui/data/Inter-Medium.otf From e070c0f5ecf0907e93a47479e98672cdbb9990e3 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Fri, 7 Jul 2023 16:40:10 +0200 Subject: [PATCH 13/13] rebase shenanigans --- .../definitions/rerun/testing/archetypes/fuzzy.fbs | 12 ++++++++++++ .../definitions/rerun/testing/components/fuzzy.fbs | 8 ++++---- .../definitions/rerun/testing/datatypes/fuzzy.fbs | 4 ++-- crates/re_types/source_hash.txt | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs index 338bdf4023bf..62b8d8b4d8a2 100644 --- a/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/archetypes/fuzzy.fbs @@ -68,6 +68,12 @@ table AffixFuzzer1 ( 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); + fuzz2014: rerun.testing.components.AffixFuzzer14 ("attr.rerun.component_optional", nullable, order: 2014); + // NOTE: nullable union -- illegal! + // fuzz2015: rerun.testing.components.AffixFuzzer15 ("attr.rerun.component_optional", nullable, order: 2015); + fuzz2016: rerun.testing.components.AffixFuzzer16 ("attr.rerun.component_optional", nullable, order: 2016); + fuzz2017: rerun.testing.components.AffixFuzzer17 ("attr.rerun.component_optional", nullable, order: 2017); + fuzz2018: rerun.testing.components.AffixFuzzer18 ("attr.rerun.component_optional", nullable, order: 2018); fuzz2101: [rerun.testing.components.AffixFuzzer1] ("attr.rerun.component_optional", nullable, order: 2101); fuzz2102: [rerun.testing.components.AffixFuzzer2] ("attr.rerun.component_optional", nullable, order: 2102); @@ -82,4 +88,10 @@ table AffixFuzzer1 ( 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); + fuzz2114: [rerun.testing.components.AffixFuzzer14] ("attr.rerun.component_optional", nullable, order: 2114); + // NOTE: nullable union -- illegal! + // fuzz2115: [rerun.testing.components.AffixFuzzer15] ("attr.rerun.component_optional", nullable, order: 2115); + fuzz2116: [rerun.testing.components.AffixFuzzer16] ("attr.rerun.component_optional", nullable, order: 2116); + fuzz2117: [rerun.testing.components.AffixFuzzer17] ("attr.rerun.component_optional", nullable, order: 2117); + fuzz2118: [rerun.testing.components.AffixFuzzer18] ("attr.rerun.component_optional", nullable, order: 2118); } diff --git a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs index c92069ecb40d..a35caaad493c 100644 --- a/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/components/fuzzy.fbs @@ -113,7 +113,7 @@ table AffixFuzzer14 ( // "attr.rust.derive": "PartialEq", // order: 1500 // ) { -// single_optional_union: rerun.testing.datatypes.AffixFuzzer3 (is_nullable, order: 115); +// single_optional_union: rerun.testing.datatypes.AffixFuzzer3 (nullable, order: 115); // } table AffixFuzzer16 ( @@ -127,14 +127,14 @@ table AffixFuzzer17 ( "attr.rust.derive": "PartialEq", order: 1700 ) { - many_optional_unions: [rerun.testing.datatypes.AffixFuzzer3] (is_nullable, order: 117); + many_optional_unions: [rerun.testing.datatypes.AffixFuzzer3] (nullable, order: 117); } table AffixFuzzer18 ( "attr.rust.derive": "PartialEq", order: 1800 ) { - many_optional_unions: [rerun.testing.datatypes.AffixFuzzer4] (is_nullable, order: 118); + many_optional_unions: [rerun.testing.datatypes.AffixFuzzer4] (nullable, order: 118); } // TODO(cmc): the ugly bug we need to take care of at some point @@ -143,5 +143,5 @@ table AffixFuzzer18 ( // order: 1400 // ) { // -// many_transparent_optionals: rerun.testing.datatypes.AffixFuzzer2 (is_nullable, order: 107); +// many_transparent_optionals: rerun.testing.datatypes.AffixFuzzer2 (nullable, order: 107); // } diff --git a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs index 9daf9c9a91c0..7cabf5ce1568 100644 --- a/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs +++ b/crates/re_types/definitions/rerun/testing/datatypes/fuzzy.fbs @@ -54,7 +54,7 @@ union AffixFuzzer3 ( order: 300 ) { degrees: FlattenedScalar (transparent, order: 100), - radians: FlattenedScalar (transparent, is_nullable, order: 101), + radians: FlattenedScalar (transparent, nullable, order: 101), craziness: __AffixFuzzer1Vec (transparent, order: 102), } @@ -72,5 +72,5 @@ union AffixFuzzer4 ( ) { single_required: __AffixFuzzer3 (transparent, order: 100), many_required: __AffixFuzzer3Vec (transparent, order: 101), - many_optional: __AffixFuzzer3Vec (transparent, order: 102, is_nullable), + many_optional: __AffixFuzzer3Vec (transparent, order: 102, nullable), } diff --git a/crates/re_types/source_hash.txt b/crates/re_types/source_hash.txt index 305d6cc97cf1..2dbfc7674452 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. -b0b0d5d6d0f4131e52331303a2c2dfdfa11e03936e97242ef897c2b158979273 +51e4e1d21a853de2f4d3b55d7d34d75cb3d6f0f7c01b701e9750256c759e9827 \ No newline at end of file